Example #1
0
        public void SetShips(Player currentPlayer, Player opponent)
        {
            for (int i = 0; i < currentPlayer.Fleet.Count; i++)
            {
                Console.WriteLine();
                currentPlayer.DrawOwnBoard();
                Ship ship = currentPlayer.Fleet[i];
                utilities.PlaceShipMessage(currentPlayer.Name, opponent.Name, ship.Name);

                int    column      = EnterColumn();
                int    row         = EnterRow();
                string orientation = EnterOrientation();

                string placedShip = currentPlayer.PlaceShip(ship, row, column, orientation);
                while (placedShip != ConstantsHandler.SHIP_PLACE_SUCCESS)
                {
                    Console.WriteLine(placedShip);
                    column      = EnterColumn();
                    row         = EnterRow();
                    orientation = EnterOrientation();
                    placedShip  = currentPlayer.PlaceShip(ship, row, column, orientation);
                }
                Console.WriteLine(placedShip);
            }
        }