C# Класс 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.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Описание методов

AddState() публичный Метод

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,
Результат void

DeleteState() публичный Метод

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
Результат void

FsmSystem() публичный Метод

public FsmSystem ( ) : System
Результат System

PerformTransition() публичный Метод

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
Результат void

Start() публичный Метод

Call this to trigger the before action on the first state in the list
public Start ( ) : void
Результат void