Beispiel #1
0
 private void SwitchState(CarState newCS)
 {
     if (newCS == null)
     {
         return;
     }
     if (state != null)
     {
         state.OnEnd();
     }
     state = newCS;
     newCS.OnStart(this);
 }