1 package edu.berkeley.fleet.two;
2 import edu.berkeley.fleet.api.*;
6 /** NOT YET FINALIZED: A description of a dock on a ship */
7 public class DockDescription {
9 private final ShipDescription ship;
10 private final String name;
11 private final boolean inbox;
12 private final boolean left;
13 private final boolean isDockless;
14 private final HashMap<String,BitVector> constants = new HashMap<String,BitVector>();
16 DockDescription(ShipDescription ship, String name, boolean left, boolean inbox) {
17 this(ship, name, left, inbox, false);
19 DockDescription(ShipDescription ship, String name, boolean left, boolean inbox, boolean isDockless) {
24 this.isDockless = isDockless;
27 public String getName() { return name; }
28 public boolean isInputDock() { return inbox; }
29 public boolean isOutputDock() { return !inbox; }
30 public boolean isDockless() { return isDockless; }
32 /** Indicates if this dock should be drawn on the "left hand side" of the ship for visual purposes */
33 boolean isLeft() { return left; }
35 /** Searches the dock-specific constants first, then ship-wide constants */
36 public BitVector getConstant(String name) {
37 BitVector ret = constants.get(name);
38 if (ret == null) ret = ship.getConstant(name);
42 void addConstant(String s, BitVector c) { constants.put(s, c); }