public Iterator<Ship> iterator() { return allocatedShips.iterator(); }
+ public void allocateShip(Ship ship) {
+ if (allocatedShips.contains(ship))
+ throw new RuntimeException("already allocated!");
+ allocatedShips.add(ship);
+ }
+
/** allocate a ship */
public Ship allocateShip(String type) {
Ship ship = null;