updates to get some of the shutdown code to execute via Program
[fleet.git] / src / edu / berkeley / fleet / loops / ShipPool.java
index 673872a..e829c7c 100644 (file)
@@ -23,6 +23,12 @@ public class ShipPool implements Iterable<Ship> {
 
     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;