public void EnterState(PhysicsStateType stateType) { if (_psmStates.ContainsKey(stateType)) { AbstractPSMState nextState = _psmStates[stateType]; EnterState(nextState); } }
public void ChangeState(PhysicsStateType toState) { _currentState.Exit(); ExitStateCallback(_currentStateType); _currentStateType = toState; _currentState = _stateMap[_currentStateType]; _currentState.Enter(); EnterStateCallback(_currentStateType); }
public void RegisterState(PhysicsStateType state, PhysicsState method) { if (_stateMap.ContainsKey(state)) { _stateMap[state] = method; } else { _stateMap.Add(state, method); } }