Esempio n. 1
0
        /// <summary>
        /// Switch state
        /// </summary>
        /// <param name="stateType">State to be switched to</param>
        private void SwitchState(GameStateType stateType)
        {
            switch (stateType)
            {
            case GameStateType.MainMenu:
                ActiveState = MainMenu.GetInstance();
                break;

            case GameStateType.GameRunning:
                ActiveState = GameRunning.GetInstance();
                break;

            case GameStateType.GamePaused:
                ActiveState = GamePaused.GetInstance();
                break;

            case GameStateType.GameOver:
                ActiveState = GameOver.GetInstance();
                break;
            }
        }
Esempio n. 2
0
 public static GamePaused GetInstance()
 {
     return(GamePaused.instance ?? (GamePaused.instance = new GamePaused()));
 }