+ public void setParent(ShipPool parent) {
+ if (this.parent!=null) {
+ for (Ship ship : allocatedShips)
+ this.parent.releaseShip(ship);
+ this.parent = null;
+ }
+ if (parent != null) {
+ for (Ship ship : allocatedShips)
+ parent.allocateShip(ship);
+ }
+ this.parent = parent;
+ }