コード例 #1
0
        /// <summary>
        /// Called when the game is over. Prints out all turns of the winner.
        /// </summary>
        /// <param name="game"></param>
        private static void GameOver(GameModel game)
        {
            Graphics.GameHeader();
            Console.WriteLine();
            Graphics.PrintInGreen(false, " The game is over! Winner is: ");
            Graphics.PrintInGreen(true, $"{game.Winner.Name}.");
            Console.WriteLine();
            Console.WriteLine($" {game.Winner.Name}'s turns are as follows:");
            Console.WriteLine();
            int i = 1; // Turn counter.

            // Print out all turns of the winner.
            foreach (var turn in game.Winner.Turns)
            {
                Console.WriteLine($" Round {i}");
                turn.PrintTurn();
                i++; // Add 1 to counter.
            }
            Console.WriteLine();
            Console.WriteLine($" That adds up to the winning score {game.WinningScore} and this game is over.");
            Console.WriteLine(" Thank you for playing!");
            Console.WriteLine();
            Graphics.PrintInGreen(true, " Press Enter to continue to Main Menu.");
            Console.ReadLine();
            MenuHandling.MainMenu();
        }
コード例 #2
0
        }                                                // Keeps track of the game.

        static void Main(string[] args)
        {
            MenuHandling.MainMenu(); // Start with main menu.
        }