コード例 #1
0
 private void PlaceShips(Event ev)
 {
     while (!ShipList.AreShipsPlaced(Player.Ships))
     {
         ShipList.PlaceShip(Player.Ships, RandomCoordinates(), RandomShipOrientation());
     }
 }
コード例 #2
0
 /// <summary>
 ///     Place ships in specific locations
 /// </summary>
 private void placeShips()
 {
     // Smallest to largest
     ShipList.PlaceShip(Player.Ships, new Coordinates(9, 8), ShipOrientation.Vertical);   // 2 length
     ShipList.PlaceShip(Player.Ships, new Coordinates(0, 7), ShipOrientation.Horizontal); // 3 length
     ShipList.PlaceShip(Player.Ships, new Coordinates(7, 1), ShipOrientation.Vertical);   // 3 length
     ShipList.PlaceShip(Player.Ships, new Coordinates(1, 9), ShipOrientation.Horizontal); // 4 length
     ShipList.PlaceShip(Player.Ships, new Coordinates(2, 4), ShipOrientation.Horizontal); // 5 length
 }
コード例 #3
0
 private void placeShips() {
     while (!ShipList.AreShipsPlaced(this.player.Ships)) {
         ShipList.PlaceShip(this.player.Ships, RandomCoordinates(), RandomShipOrientation());
     }
 }