private FSMState GetGoalState(FSMState.FSMStates goalState) { foreach (FSMState state in states) { if (state.Type == goalState) { return(state); } } return(null); }
public void Update(GameTime gameTime) { if (currentState == null) { currentState = defaultState; } if (currentState == null) { return; } FSMState.FSMStates goalType = currentState.CheckTransitions(); ChangeState(goalType); currentState.Update(gameTime); }
public UnitFSMState(FSMState.FSMStates type, UnitController controller, GameplayManager gm) : base(type) { this.controller = controller; this.gm = gm; }