Exemplo n.º 1
0
 public void EnterState(PhysicsStateType stateType)
 {
     if (_psmStates.ContainsKey(stateType))
     {
         AbstractPSMState nextState = _psmStates[stateType];
         EnterState(nextState);
     }
 }
Exemplo n.º 2
0
    public void ChangeState(PhysicsStateType toState)
    {
        _currentState.Exit();
        ExitStateCallback(_currentStateType);

        _currentStateType = toState;
        _currentState = _stateMap[_currentStateType];

        _currentState.Enter();
        EnterStateCallback(_currentStateType);
    }
Exemplo n.º 3
0
 public void RegisterState(PhysicsStateType state, PhysicsState method)
 {
     if (_stateMap.ContainsKey(state))
     {
         _stateMap[state] = method;
     }
     else
     {
         _stateMap.Add(state, method);
     }
 }