예제 #1
0
 public void SetStateByName(string wantedState)
 {
     if (wantedState != null &&
         wantedState != currentState.GetType().Name)
     {
         SwitchToNewState(wantedState);
     }
 }
예제 #2
0
 private void SwitchToNewState(string newState)
 {
     currentState     = possibleStates[newState];
     currentStateName = currentState.GetType().Name;
 }