ShipPool.allocateShip() needs to invoke ancestor/parent allocateShip()
authorAdam Megacz <adam@megacz.com>
Mon, 27 Jul 2009 03:22:28 +0000 (20:22 -0700)
committerAdam Megacz <adam@megacz.com>
Mon, 27 Jul 2009 03:22:28 +0000 (20:22 -0700)
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);
     }