Example #1
0
        private void playRematchGame()
        {
            string userInput = null;

            do
            {
                GameUI.PrintMassageLine(GameUI.Messages.k_IsRematchGameMassage);
                userInput = Console.ReadLine();
                if (userInput.ToLower() == GameUI.Messages.k_UserInputStringEqualsYes)
                {
                    m_CountBlack      = 0;
                    m_CountWhite      = 0;
                    m_TurnOf          = eCell.White;
                    m_GameBoardEngine = new GameBoardEngine(m_BoardSize);
                    startGame();
                }
                else if (userInput.ToLower() != GameUI.Messages.k_UserInputStringEqualsNo)
                {
                    GameUI.PrintMassageLine(GameUI.Messages.k_InvalidInputUserNameMassage);
                }
            }while (userInput.ToLower() != GameUI.Messages.k_UserInputStringEqualsNo);
            GameUI.EndGameMessage();
        }
Example #2
0
        public void StartMenu()
        {
            SetUserName(ref m_Player1);
            v_IsVsComputer = GameUI.IsVsComputer();
            if (v_IsVsComputer)
            {
                m_Player2 = GameUI.Messages.k_ComputerName;
            }
            else
            {
                do
                {
                    SetUserName(ref m_Player2);
                    if (m_Player1 == m_Player2)
                    {
                        GameUI.PrintMassageLine(GameUI.Messages.k_InvalidUserNameInputMassage);
                    }
                }while (m_Player1 == m_Player2);
            }

            m_BoardSize       = GameUI.GetBoardSize();
            m_GameBoardEngine = new GameBoardEngine(m_BoardSize);
            startGame();
        }