public void process(TFSMWorkingData wData) { if (wData._isFirstUpdate) { wData._currentState = wData._defaultState; if (wData._currentState != null) { wData._currentState.enter(wData); wData._isFirstUpdate = false; } } TFSMState newState = wData._currentState; if (wData._stimulus != null) { newState = wData._stimulus.getGoalState(); wData._stimulus = null; } if (newState != wData._currentState) { if (wData._currentState != null) { wData._currentState.exit(wData); } wData._currentState = newState; if (wData._currentState != null) { wData._currentState.enter(wData); } } if (wData._currentState != null) { wData._currentState.execute(wData); } }
public TFSMMachine addState(string id, TFSMState state) { if (_stateLinks.ContainsKey(id)) { TLogger.WARNING("name conflict for this state: "+ id); return this; } state.name = id; state.stateMachine = this; _states.Add(id, state); return this; }
public TFSMMachine addState(string id, TFSMState state) { if (_stateLinks.ContainsKey(id)) { TLogger.WARNING("name conflict for this state: " + id); return(this); } state.name = id; state.stateMachine = this; _states.Add(id, state); return(this); }
public TFSMLink(TFSMState from, TFSMState to) { _from = from; _to = to; }