Beispiel #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);
        }
Beispiel #2
0
        public Player()
        {
            gameboard = new Gameboard();

            PlayerSetup();
            fleet = new List <Ship>()
            {
                gameboard.battleship, gameboard.carrier, gameboard.submarine, gameboard.destroyer
            };
        }
Beispiel #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
     };
 }
Beispiel #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);
        }
Beispiel #5
0
 //constructor
 public Player()
 {
     attackingBoard = new Gameboard();
     defendingBoard = new Gameboard();
     playerName     = SelectPlayerName();
 }
Beispiel #6
0
        static void Main(string[] args)
        {
            Gameboard gameboard = new Gameboard();

            gameboard.DisplayGameboard();
        }