Exemplo n.º 1
0
        public static bool TurnMain(Player player1, Player player2, Board board1, Board board2)
        {
            bool       goesNext      = UserIO.GoesFirst(player1, player2);
            Player     currentPlayer = new Player();
            Board      currentBoard  = new Board();
            ShotStatus shotStatus;

            while (true) //set condition to victory == false?
            {
                if (goesNext == true)
                {
                    currentPlayer = player1;
                    currentBoard  = board2;
                    goesNext      = false;
                }
                else
                {
                    currentPlayer = player2;
                    currentBoard  = board1;
                    goesNext      = true;
                }


                //start current player's turn
                shotStatus = PlayerTurn(currentPlayer, currentBoard);
                //\\check for victory?
                if (shotStatus == ShotStatus.Victory)
                {
                    return(true);
                }

                Console.WriteLine($"Press any key to end {currentPlayer.Name}'s turn");
                Console.ReadKey(true);
                Console.Clear();
            }
        }