示例#1
0
 /// <summary>
 /// Makes sure that the currently active game state calls Reset.
 /// </summary>
 public void Reset()
 {
     if (currentGameState != null)
     {
         currentGameState.Reset();
     }
 }
示例#2
0
 /// <summary>
 /// Switches to a different active game state.
 /// </summary>
 /// <param name="name">The name of the game state to set as the new active one.</param>
 public void SwitchTo(string name)
 {
     if (gameStates.ContainsKey(name))
     {
         currentGameState = gameStates[name];
         currentGameState.Reset();
     }
 }
示例#3
0
 public void Reset()
 {
     _current.Reset();
 }
 public void Reset()
 {
     currentGameState?.Reset();
 }