public enum Transition { NullTransition = 0, } public enum StateID { NullStateID = 0, } public abstract class FSMState { protected Dictionary<Transition, StateID> map = new Dictionary<Transition, StateID>(); protected StateID stateID; public StateID ID { get { return stateID; } }
public void AddTransition(Transition trans, StateID id){} public void DeleteTransition(Transition trans){} public StateID GetOutputState(Transition trans){}
public virtual void DoBeforeEntering() { } public virtual void DoBeforeLeaving() { }
public abstract void Reason(GameObject player, GameObject npc); public abstract void Act(GameObject player, GameObject npc); }
public class FSMSystem { private List<FSMState> states; private StateID currentStateID; public StateID CurrentStateID { get { return currentStateID; } } private FSMState currentState; public FSMState CurrentState { get { return currentState; } } public FSMSystem() { states = new List<FSMState>(); }
public void AddState(FSMState s){} public void DeleteState(StateID id){} public void PerformTransition(Transition trans){} }