Пример #1
0
        private static void printScoreAndAskForMoreGame()
        {
            Console.WriteLine();
            Console.WriteLine();
            if (s_Game.WinnerID == e_PlayerID.FIRST && s_Game.e_GameStatus == e_StatusOFGame.WIN)
            {
                Console.WriteLine("The Winner is: " + Player1.Name);
            }
            else if (s_Game.WinnerID == e_PlayerID.SECOND && s_Game.e_GameStatus == e_StatusOFGame.WIN)
            {
                Console.WriteLine("The Winner is: " + Player2.Name);
            }
            else
            {
                Console.WriteLine("It's A Tie!");
            }

            Console.WriteLine("The Score is: " + Player1.Name + ": " + Player1.Score);
            Console.WriteLine("The Score is: " + Player2.Name + ": " + Player2.Score);
            Console.WriteLine();
            Console.WriteLine("Do you want to have a rematch? Y / N");
            bool invalidInput = false;

            do
            {
                string userInput = Console.ReadLine();
                if (userInput.Equals("Y") || userInput.Equals("y"))
                {
                    invalidInput = true;
                    Board        = new Board(BoardSize, Player1, Player2);
                    s_Game       = new Game(Player1, Player2, Board);
                    s_Game.RefreshBoardGame();
                    s_LastMoveStr = null;
                }
                else if (userInput.Equals("N") || userInput.Equals("n"))
                {
                    Screen.Clear();
                    getUserInitialInput();
                }
                else
                {
                    Console.WriteLine("Do you want to have a rematch? Y / N");
                }
            }while (!invalidInput);
        }