C# Class FsmSystem, nightmare_cooperative

FSMSystem class represents the Finite State Machine class. It has a List with the States the NPC has and methods to add, delete a state, and to change the current state the Machine is on.
Afficher le fichier Open project: jonbro/nightmare_cooperative Class Usage Examples

Méthodes publiques

Méthode Description
AddState ( FsmState, s ) : void

This method places new states inside the FSM, or prints an ERROR message if the state was already inside the List. First state added is also the initial state.

DeleteState ( FsmStateId id ) : void

This method delete a state from the FSM List if it exists, or prints an ERROR message if the state was not on the List.

FsmSystem ( ) : System
PerformTransition ( FsmTransitionId trans ) : void

This method tries to change the state the FSM is in based on the current state and the transition passed. If current state doesn't have a target state for the transition passed, an ERROR message is printed.

Start ( ) : void

Call this to trigger the before action on the first state in the list

Method Details

AddState() public méthode

This method places new states inside the FSM, or prints an ERROR message if the state was already inside the List. First state added is also the initial state.
public AddState ( FsmState, s ) : void
s FsmState,
Résultat void

DeleteState() public méthode

This method delete a state from the FSM List if it exists, or prints an ERROR message if the state was not on the List.
public DeleteState ( FsmStateId id ) : void
id FsmStateId
Résultat void

FsmSystem() public méthode

public FsmSystem ( ) : System
Résultat System

PerformTransition() public méthode

This method tries to change the state the FSM is in based on the current state and the transition passed. If current state doesn't have a target state for the transition passed, an ERROR message is printed.
public PerformTransition ( FsmTransitionId trans ) : void
trans FsmTransitionId
Résultat void

Start() public méthode

Call this to trigger the before action on the first state in the list
public Start ( ) : void
Résultat void