コード例 #1
0
        /// <summary>
        /// Draws the current state of the game to the screen.
        /// </summary>
        /// <remarks>
        /// What is drawn depends upon the state of the game.
        /// </remarks>
        public void DrawScreen()
        {
            _utility.DrawBackground(this);

            switch (CurrentState)
            {
            case GameState.ViewingMainMenu:
                _menu.DrawMainMenu(this);
                break;

            case GameState.ViewingGameMenu:
                _menu.DrawGameMenu(this);
                break;

            case GameState.AlteringSettings:
                _menu.DrawSettings(this);
                break;

            case GameState.Deploying:
                _deployment.DrawDeployment(this);
                _highScore.DrawHighScore(_resources);
                _menu.DrawSetting(this);
                DrawAIdifficulty();
                break;

            case GameState.Discovering:
                _discovery.DrawDiscovery(this);
                _highScore.DrawHighScore(_resources);
                DrawAIdifficulty();
                break;

            case GameState.EndingGame:
                _endGame.DrawEndOfGame(this);
                break;

            case GameState.ViewingHighScores:
                _highScore.DrawHighScores(this);
                break;
            }

            _utility.DrawAnimations();

            SwinGame.RefreshScreen();
        }
コード例 #2
0
        /*<summary>
         * Draws the current state of the game to the screen.
         *</summary>
         *<remarks>
         * What is drawn depends upon the state of the game.
         *</remarks>
         */
        public static void DrawScreen()
        {
            UtilityFunctions.DrawBackground();
            switch (CurrentState)
            {
            case GameState.ViewingMainMenu:
                MenuController.DrawMainMenu();
                break;

            case GameState.ViewingGameMenu:
                MenuController.DrawGameMenu();
                break;

            case GameState.AlteringSettings:
                MenuController.DrawSettings();
                break;

            case GameState.AlteringShips:
                MenuController.DrawShipsMenu();
                break;

            case GameState.Deploying:
                DeploymentController.DrawDeployment();
                break;

            case GameState.Discovering:
                DiscoveryController.DrawDiscovery();
                break;

            case GameState.EndingGame:
                EndingGameController.DrawEndOfGame();
                break;

            case GameState.ViewingHighScores:
                HighScoreController.DrawHighScores();
                break;
            }
            UtilityFunctions.DrawAnimations();
            SwinGame.RefreshScreen();
        }