further cleanup of MarinaTest
[fleet.git] / src / edu / berkeley / fleet / marina / MarinaFleet.java
1 package edu.berkeley.fleet.marina;
2 import edu.berkeley.fleet.api.*;
3 import edu.berkeley.fleet.two.*;
4 import edu.berkeley.fleet.*;
5 import java.util.*;
6
7 public class MarinaFleet extends FleetTwoFleet {
8
9     MarinaShip fakeShip = new MarinaShip(this);
10     MarinaDock onlyDock = new MarinaDock(fakeShip, true);
11
12     public MarinaFleet() {
13         // use "internal encoding"
14         super(true);
15     }
16
17     public BitVector   encodeInstruction(Dock dispatchFrom, Instruction instruction) {
18         return encodeInstruction(instruction, dispatchFrom);
19     }
20
21     public Iterator<Ship> iterator() {
22         HashSet hs = new HashSet<Ship>();
23         hs.add(fakeShip);
24         return hs.iterator();
25     }
26
27     public Ship getShip(String type, int ordinal) {
28         throw new RuntimeException("not implemented");
29     }
30
31     public FleetProcess run(Instruction[] instructions) {
32         throw new RuntimeException("not implemented");
33     }
34
35     public BitVector getDestAddr(Path path) {
36         if (path==null) return new BitVector(0);
37         return ((MarinaPath)path).bv;
38     }
39
40     public Dock getOnlyDock() {
41         return onlyDock;
42     }
43 }