ShipPool.allocateShip() needs to invoke ancestor/parent allocateShip()
[fleet.git] / src / edu / berkeley / fleet / loops / ShipPool.java
index 23b9a04..82a5296 100644 (file)
@@ -27,6 +27,8 @@ public class ShipPool implements Iterable<Ship> {
     public void allocateShip(Ship ship) {
         if (allocatedShips.contains(ship))
             throw new RuntimeException("already allocated!");
+        if (parent != null)
+            parent.allocateShip(ship);
         allocatedShips.add(ship);
     }