private final String name;
private final SlipwayShip ship;
- private final Destination[] ports;
+ private Destination[] ports;
public Iterable<Destination> getDestinations() {
- HashSet<Destination> ret = new HashSet<Destination>();
+ ArrayList<Destination> ret = new ArrayList<Destination>();
for(Destination d : ports) ret.add(d);
return ret;
}
ship.addBenkoBox(name, this);
}
+ public void addDestination(String dest) {
+ Destination[] newports = new Destination[ports.length+1];
+ System.arraycopy(ports, 0, newports, 0, ports.length);
+ newports[newports.length-1] = new VirtualPort(dest);
+ ports = newports;
+ }
public class VirtualPort extends Destination {
public String name;