|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgames.strategy.engine.data.Route
public class Route
A route between two territories.
A route consists of a start territory, and a sequence of steps. To create a route
do,
Route aRoute = new Route();
route.setStart(someTerritory);
route.add(anotherTerritory);
route.add(yetAnotherTerritory);
| Constructor Summary | |
|---|---|
Route()
|
|
Route(java.util.List<Territory> route)
|
|
Route(Territory start,
Territory... route)
|
|
| Method Summary | |
|---|---|
void |
add(Territory t)
Add the given territory to the end of the route. |
boolean |
allMatch(Match<Territory> aMatch)
Do all territories in this route match the given match? |
Territory |
at(int i)
Get the territory we will be in after the i'th step for this route has been made. |
boolean |
crossesWater()
Determines if the route crosses water by checking if any of the territories except the start and end are sea territories. |
boolean |
equals(java.lang.Object o)
|
boolean |
extend(Route baseRoute)
does this route extend another route |
Territory |
getEnd()
Get the last territory in the route, this is the destination. |
int |
getLength()
|
java.util.Collection<Territory> |
getMatches(Match<Territory> aMatch)
Get all territories in this route match the given match? |
Territory |
getStart()
Get the start territory for this route. |
java.util.List<Territory> |
getTerritories()
Returns a collection of all territories in this route, including the start. |
int |
hashCode()
|
java.util.Iterator<Territory> |
iterator()
|
static Route |
join(Route r1,
Route r2)
Join the two routes. |
void |
setStart(Territory t)
Set the start of this route. |
boolean |
someMatch(Match<Territory> aMatch)
Do some territories in this route match the given match? |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Route()
public Route(java.util.List<Territory> route)
public Route(Territory start,
Territory... route)
| Method Detail |
|---|
public static Route join(Route r1,
Route r2)
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic void setStart(Territory t)
public Territory getStart()
public boolean crossesWater()
public void add(Territory t)
public int getLength()
public Territory at(int i)
public boolean allMatch(Match<Territory> aMatch)
public boolean someMatch(Match<Territory> aMatch)
public java.util.Collection<Territory> getMatches(Match<Territory> aMatch)
public java.lang.String toString()
toString in class java.lang.Objectpublic java.util.List<Territory> getTerritories()
public Territory getEnd()
public boolean extend(Route baseRoute)
public java.util.Iterator<Territory> iterator()
iterator in interface java.lang.Iterable<Territory>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||