public SKStateMachine(T context, SKState <T> initialState) { this._context = context; // setup our initial state initialState.setMachineAndContext(this, context); _states[initialState.GetType()] = initialState; _currentState = initialState; _currentState.begin(); }
/// <summary> /// adds the state to the machine /// </summary> public void addState(SKState <T> state) { state.setMachineAndContext(this, _context); _states[state.GetType()] = state; }