|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmegamek.common.TurnVectors
public class TurnVectors
A handy utility class for collecting Vectors of
TurnOrdered markers and then walking through them.
| Constructor Summary | |
|---|---|
TurnVectors(int normalCount,
int totalCount,
int ssCount,
int jsCount,
int wsCount,
int dsCount,
int scCount,
int aeroCount,
int evenCount,
int min)
Construct empty Vectors with the given capacities. |
|
| Method Summary | |
|---|---|
void |
addAero(TurnOrdered marker)
|
void |
addDropship(TurnOrdered marker)
|
void |
addEven(TurnOrdered marker)
Add a TurnOrdered marker for a turn that must occur after
all normal turns. |
void |
addJumpship(TurnOrdered marker)
|
void |
addNormal(TurnOrdered marker)
Add a TurnOrdered marker for a "normal" turn. |
void |
addSmallCraft(TurnOrdered marker)
|
void |
addSpaceStation(TurnOrdered marker)
|
void |
addWarship(TurnOrdered marker)
|
int |
getAeroTurns()
|
int |
getDropshipTurns()
|
int |
getEvenTurns()
Get the number of turns that must occur after all normal turns. |
int |
getJumpshipTurns()
|
int |
getMin()
Return the smallest number of times one of the TurnOrdered
objects is present in the list of "normal" turns. |
int |
getNormalTurns()
|
int |
getSmallCraftTurns()
|
int |
getSpaceStationTurns()
|
int |
getTotalTurns()
Get the number of normal turns. |
int |
getWarshipTurns()
|
boolean |
hasMoreAeroElements()
Determine if we've iterated to the end of our aero turn markers. |
boolean |
hasMoreDropshipElements()
Determine if we've iterated to the end of our dropship turn markers. |
boolean |
hasMoreElements()
Determine if we've iterated to the end of our total turn markers. |
boolean |
hasMoreEvenElements()
Determine if we've iterated to the end of our even turn markers. |
boolean |
hasMoreJumpshipElements()
Determine if we've iterated to the end of our jumpship turn markers. |
boolean |
hasMoreNormalElements()
Determine if we've iterated to the end of our turn markers. |
boolean |
hasMoreSmallCraftElements()
Determine if we've iterated to the end of our small craft turn markers. |
boolean |
hasMoreSpaceStationElements()
Determine if we've iterated to the end of our space station turn markers. |
boolean |
hasMoreWarshipElements()
Determine if we've iterated to the end of our warship turn markers. |
TurnOrdered |
nextAeroElement()
Get the next "aero" TurnOrdered marker. |
TurnOrdered |
nextDropshipElement()
Get the next "dropship" TurnOrdered marker. |
TurnOrdered |
nextElement()
Get the next "total" TurnOrdered marker. |
TurnOrdered |
nextEvenElement()
Get the next "even" TurnOrdered marker. |
TurnOrdered |
nextJumpshipElement()
Get the next "jumpship" TurnOrdered marker. |
TurnOrdered |
nextNormalElement()
Get the next TurnOrdered marker. |
TurnOrdered |
nextSmallCraftElement()
Get the next "small craft" TurnOrdered marker. |
TurnOrdered |
nextSpaceStationElement()
Get the next "space station" TurnOrdered marker. |
TurnOrdered |
nextWarshipElement()
Get the next "warship" TurnOrdered marker. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TurnVectors(int normalCount,
int totalCount,
int ssCount,
int jsCount,
int wsCount,
int dsCount,
int scCount,
int aeroCount,
int evenCount,
int min)
Vectors with the given capacities.
normalCount - the int count of
TurnOrdered object markers for normal turnsevenCount - the int count of markers for turns that
occur after all normal turns.min - the smallest int number of times one of the
TurnOrdered objects appears in the normal list.| Method Detail |
|---|
public int getEvenTurns()
int count of even turns.public int getTotalTurns()
int count of normal turns.public int getNormalTurns()
public int getSpaceStationTurns()
public int getJumpshipTurns()
public int getWarshipTurns()
public int getDropshipTurns()
public int getSmallCraftTurns()
public int getAeroTurns()
public void addEven(TurnOrdered marker)
TurnOrdered marker for a turn that must occur after
all normal turns.
marker - the TurnOrdered marker for a even turn.
java.lang.IllegalStateException - if as many markers have been added for
even turns as indicated at construction.public void addNormal(TurnOrdered marker)
TurnOrdered marker for a "normal" turn.
marker - the TurnOrdered marker for a "normal" turn.
java.lang.IllegalStateException - if as many markers have been added for
normal turns as indicated at construction.public void addSpaceStation(TurnOrdered marker)
public void addWarship(TurnOrdered marker)
public void addJumpship(TurnOrdered marker)
public void addDropship(TurnOrdered marker)
public void addSmallCraft(TurnOrdered marker)
public void addAero(TurnOrdered marker)
public boolean hasMoreNormalElements()
true if we've read all turn markers.public TurnOrdered nextNormalElement()
TurnOrdered marker.
TurnOrdered marker; all "even" markers will be
returned after all "normal" markers.public boolean hasMoreEvenElements()
true if we've read all turn markers.public TurnOrdered nextElement()
TurnOrdered marker.
nextElement in interface java.util.Enumeration<TurnOrdered>TurnOrdered marker.public boolean hasMoreElements()
hasMoreElements in interface java.util.Enumeration<TurnOrdered>true if we've read all turn markers.public TurnOrdered nextSpaceStationElement()
TurnOrdered marker.
TurnOrdered marker.public boolean hasMoreSpaceStationElements()
true if we've read all turn markers.public TurnOrdered nextJumpshipElement()
TurnOrdered marker.
TurnOrdered marker.public boolean hasMoreJumpshipElements()
true if we've read all turn markers.public TurnOrdered nextWarshipElement()
TurnOrdered marker.
TurnOrdered marker.public boolean hasMoreWarshipElements()
true if we've read all turn markers.public TurnOrdered nextDropshipElement()
TurnOrdered marker.
TurnOrdered marker.public boolean hasMoreDropshipElements()
true if we've read all turn markers.public TurnOrdered nextSmallCraftElement()
TurnOrdered marker.
TurnOrdered marker.public TurnOrdered nextAeroElement()
TurnOrdered marker.
TurnOrdered marker.public boolean hasMoreSmallCraftElements()
true if we've read all turn markers.public boolean hasMoreAeroElements()
true if we've read all turn markers.public TurnOrdered nextEvenElement()
TurnOrdered marker.
TurnOrdered marker.public int getMin()
TurnOrdered
objects is present in the list of "normal" turns.
int number of times.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||