Beispiel #1
0
        public void PutShipsOnBoard(Player player)
        {
            PrintGameBoard(player);
            ShipPlacementMenu();
            string response = Console.ReadLine();

            switch (response)
            {
            case "1":
                gameBoardReady = false;
                myDestroyer.PlaceShip(mySubmarine, myBattleship, myAircraftCarrier);
                PutShipsOnBoard(player);
                break;

            case "2":
                gameBoardReady = false;
                mySubmarine.PlaceShip(myDestroyer, myBattleship, myAircraftCarrier);
                PutShipsOnBoard(player);
                break;

            case "3":
                gameBoardReady = false;
                myBattleship.PlaceShip(myDestroyer, mySubmarine, myAircraftCarrier);
                PutShipsOnBoard(player);
                break;

            case "4":
                gameBoardReady = false;
                myAircraftCarrier.PlaceShip(myDestroyer, mySubmarine, myBattleship);
                PutShipsOnBoard(player);
                break;

            case "9":
                gameBoardReady = false;
                string res = Console.ReadLine();
                switch (res)
                {
                case "1":
                    myAircraftCarrier.SetLocation(3, 3, 3, 7);
                    myBattleship.SetLocation(10, 10, 13, 10);
                    mySubmarine.SetLocation(16, 16, 16, 18);
                    myDestroyer.SetLocation(3, 15, 3, 16);
                    break;

                case "2":
                    myAircraftCarrier.SetLocation(10, 10, 14, 10);
                    myBattleship.SetLocation(3, 3, 3, 6);
                    mySubmarine.SetLocation(16, 16, 18, 16);
                    myDestroyer.SetLocation(18, 2, 18, 3);
                    break;

                case "3":
                    myAircraftCarrier.SetLocation(18, 7, 18, 11);
                    myBattleship.SetLocation(3, 3, 6, 3);
                    mySubmarine.SetLocation(10, 10, 10, 12);
                    myDestroyer.SetLocation(4, 17, 4, 18);
                    break;
                }
                break;

            case "5":
                break;

            default:
                PutShipsOnBoard(player);
                break;
            }
        }