示例#1
0
        protected void SetSize(Ships initiateShips)
        {
            switch (chosenShip)
            {
            case "carrier":
                initiateShips.ShipSize = 5;
                initiateShips.ShipIcon = "[C]";
                break;

            case "battleship":
                initiateShips.ShipSize = 4;
                initiateShips.ShipIcon = "[B]";
                break;

            case "submarine":
                initiateShips.ShipSize = 3;
                initiateShips.ShipIcon = "[S]";
                break;

            case "cruiser":
                initiateShips.ShipSize = 3;
                initiateShips.ShipIcon = "[c]";
                break;

            case "destroyer":
                initiateShips.ShipSize = 2;
                initiateShips.ShipIcon = "[D]";
                break;

            default:
                break;
            }
        }
示例#2
0
 public Player()
 {
     initiateShips = new Ships();
     usedShips     = new List <string>();
     hitsBoard     = new string[10, 10];
     shipsBoard    = new string[10, 10];
 }