public abstract class BenkoBox extends Destination {
- /** you should extend subclasses, not this class directly */
- //FIXME
public BenkoBox() { }
/** the descriptive name of this benkobox (relative to its ship) */
public abstract class Destination {
- Destination() { }
+ public Destination() { }
/** return the Ship to which this BenkoBox belongs */
public abstract Ship getShip();
/** subclasses may be assured that this will be called exactly once */
protected abstract void _terminate();
- public synchronized void terminate() {
+ public final synchronized void terminate() {
if (terminated) return;
terminated = true;
_terminate();
}
- public boolean isTerminated() {
+ public final boolean isTerminated() {
return terminated;
}
this.benkoBox=benkoBox;
this.count=count;
this.killOnlyStandingInstructions = killOnlyStandingInstructions;
+ if (killOnlyStandingInstructions && count !=1)
+ throw new RuntimeException("currently, kill* must have count=1");
}
- public String toString() { return (count>1 ? "["+count+"] " : "") + "kill"; }
+ public String toString() { return (count>1 ? "["+count+"] " : "") + "kill" + (killOnlyStandingInstructions ? "*" : ""); }
}
public String toString() {
String off = ""+offset;
if (offset > 0) off = "+"+off;
- return "(@"+off+":"+size+"): sendto " + dest;
+ return "(CBD @"+off+"+"+size+"): sendto " + dest;
}
}
}