implement port percolation
[fleet.git] / src / edu / berkeley / fleet / two / ShipDescription.java
index d1158ea..3c8a5ae 100644 (file)
@@ -86,11 +86,14 @@ public class ShipDescription implements Iterable<DockDescription> {
                 else if (key.startsWith("percolate")) { 
                     key = s;
                     key = key.substring("percolate".length()+1).trim();
-                    boolean up = key.startsWith("up");
+                    PercolatedPort.PortType type = null;
+                    if (key.startsWith("up")) type = PercolatedPort.PortType.UP;
+                    if (key.startsWith("down")) type = PercolatedPort.PortType.DOWN;
+                    if (key.startsWith("inout")) type = PercolatedPort.PortType.INOUT;
                     key = key.substring(key.indexOf(':')+1).trim();
                     String name = key.substring(0, key.indexOf(' '));
                     int width = Integer.parseInt(key.substring(key.indexOf(' ')).trim());
-                    percolatedPorts.add(new PercolatedPort(name, width, up));
+                    percolatedPorts.add(new PercolatedPort(name, width, type));
                     continue;
                 }
                 else if (key.startsWith("constant")) {