/// <summary> /// Makes sure that the currently active game state calls Reset. /// </summary> public void Reset() { if (currentGameState != null) { currentGameState.Reset(); } }
/// <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(); } }
public void Reset() { _current.Reset(); }
public void Reset() { currentGameState?.Reset(); }