Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
 /// <summary>
 /// adds the state to the machine
 /// </summary>
 public void addState(SKState <T> state)
 {
     state.setMachineAndContext(this, _context);
     _states[state.GetType()] = state;
 }