+ public BenkoBox getBenkoBox(String s) {
+ for(BenkoBox b : getBenkoBoxes())
+ if (b.getName().equals(s))
+ return b;
+ throw new RuntimeException("unknown port \""+getType()+"."+s+"\"");
+ }
+
+ public int getOrdinal() {
+ int ord = 0;
+ for(Ship s : getFleet()) {
+ if (s==this) return ord;
+ if (s.getType() != null && s.getType().equals(getType())) ord++;
+ }
+ throw new RuntimeException("inconsistency: Ship does not belong to its own Fleet!");
+ }
+
+ public String toString() { return getType() + "[" + getOrdinal() + "]"; }
+