Example #1
0
        /// <summary>
        /// Helper method that displays a congratulation message and plays a cheering sound if player has won the game.
        /// </summary>
        private void DisplayYouWinSection()
        {
            Console.WriteLine(YouWinMessage);
            this.musicPlayer.PlayWinMusic();
            Scoreboard.HighScore(this.GameBoard.OpenCellsCounter);
            Console.ReadKey();

            this.gameStatus = GameStatus.Restart;
        }
Example #2
0
        /// <summary>
        /// Helper method that ends the game in case player has stepped on a mine.
        /// </summary>
        private void DisplayGameOverSection()
        {
            this.musicPlayer.PlayGameOverMusic();
            this.gamePrinter.PrintPlayingField(this.GameBoard, this.gameStatus);
            this.gameStatus = GameStatus.Restart;

            Scoreboard.HighScore(this.GameBoard.OpenCellsCounter);
            int score = this.GameBoard.OpenCellsCounter;

            Console.WriteLine(GameOverMessage);
            Console.WriteLine("{0} {1}", ScoreMessage, score);
            Console.ReadKey();
        }