public static void putMemoryShipInDispatchMode(FleetProcess fp, Ship memoryShip) {
Context ctx = new Context(fp.getFleet());
LoopFactory lf;
+
lf = new LoopFactory(ctx, memoryShip.getDock("out"), 0);
lf.abortLoopIfTorpedoPresent();
lf.collectPacket();
lf.sendWord(null);
+
+ lf = new LoopFactory(ctx, memoryShip.getDock("inCBD"), 0);
+ lf.abortLoopIfTorpedoPresent();
+ lf.recvWord();
+ lf.deliver();
+
ctx.dispatch(fp);
}
public static void removeMemoryShipFromDispatchMode(FleetProcess fp, Ship memoryShip) {
fp.sendToken(memoryShip.getDock("out").getInstructionDestination());
+ fp.sendToken(memoryShip.getDock("inCBD").getInstructionDestination());
}
public static void main(String[] s) throws Exception {