projects
/
fleet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updates to get some of the shutdown code to execute via Program
[fleet.git]
/
src
/
edu
/
berkeley
/
fleet
/
loops
/
ShipPool.java
diff --git
a/src/edu/berkeley/fleet/loops/ShipPool.java
b/src/edu/berkeley/fleet/loops/ShipPool.java
index
673872a
..
e829c7c
100644
(file)
--- a/
src/edu/berkeley/fleet/loops/ShipPool.java
+++ b/
src/edu/berkeley/fleet/loops/ShipPool.java
@@
-23,6
+23,12
@@
public class ShipPool implements Iterable<Ship> {
public Iterator<Ship> iterator() { return allocatedShips.iterator(); }
public Iterator<Ship> iterator() { return allocatedShips.iterator(); }
+ public void allocateShip(Ship ship) {
+ if (allocatedShips.contains(ship))
+ throw new RuntimeException("already allocated!");
+ allocatedShips.add(ship);
+ }
+
/** allocate a ship */
public Ship allocateShip(String type) {
Ship ship = null;
/** allocate a ship */
public Ship allocateShip(String type) {
Ship ship = null;