Пример #1
0
        public void PlayerSetup()
        {
            Console.WriteLine("Enter player name");
            name = Console.ReadLine();
            bool check = false;

            do
            {
                PlaceShip("battleship", 5);
                PlaceShip("carrier", 4);
                PlaceShip("submarine", 3);
                PlaceShip("destroyer", 2);
                gameboard.Readout(gameboard.playerGameBoard);
                Console.WriteLine("are the ships where you want them?");
                string setup = Console.ReadLine();
                if (setup == "yes" || setup == "y" || setup == "ok")
                {
                    check = true;
                }
                else
                {
                    gameboard = new Gameboard();
                }
            }while (check == false);
        }
Пример #2
0
        public Player()
        {
            gameboard = new Gameboard();

            PlayerSetup();
            fleet = new List <Ship>()
            {
                gameboard.battleship, gameboard.carrier, gameboard.submarine, gameboard.destroyer
            };
        }
Пример #3
0
 //constructor
 public Players()
 {
     opponentsBoard  = new Gameboard();
     gameboard       = new Gameboard();
     score           = 0;
     destroyer       = new Destroyer();
     submarine       = new Submarine();
     battleship      = new Battleship();
     aircraftCarrier = new AircraftCarrier();
     fleet           = new List <Ships>()
     {
         destroyer, submarine, battleship, aircraftCarrier
     };
 }
Пример #4
0
        public Player()
        {
            gameboard = new Gameboard();
            name      = Console.ReadLine();
            Battleship battleship = new Battleship();
            Carrier    carrier    = new Carrier();
            Submarine  submarine  = new Submarine();
            Destroyer  destroyer  = new Destroyer();

            allShips.Add(battleship);
            allShips.Add(carrier);
            allShips.Add(submarine);
            allShips.Add(destroyer);
        }
Пример #5
0
 //constructor
 public Player()
 {
     attackingBoard = new Gameboard();
     defendingBoard = new Gameboard();
     playerName     = SelectPlayerName();
 }
Пример #6
0
        static void Main(string[] args)
        {
            Gameboard gameboard = new Gameboard();

            gameboard.DisplayGameboard();
        }