예제 #1
0
 /// <summary> Appel la fonction Exit() du vieux state et le Enter() du nouveau </summary>
 /// <param name="newState"> Nouveau state </param>
 public void ChangeState(IStates newState)
 {
     currentState.Exit();
     previousState = currentState;
     currentState  = newState;
     currentState.Enter();
 }
예제 #2
0
    public void ChangeState(IStates newState)
    {
        if (currentState != null)
        {
            currentState.Exit();
        }

        currentState = newState;
        currentState.Enter(this);
    }