Esempio n. 1
0
        public void SwitchState(GameStateType stateType)
        {
            switch (stateType)
            {
            case GameStateType.GameRunning:
                ActiveState = GameRunning.GetInstance();
                break;

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

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

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

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