|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgames.strategy.engine.data.GameDataComponent
games.strategy.engine.data.GameMap
public class GameMap
| Field Summary | |
|---|---|
static Match<Territory> |
IS_LAND
|
static Match<Territory> |
IS_LAND_OR_WATER
|
static Match<Territory> |
IS_WATER
|
| Method Summary | |
|---|---|
protected void |
addConnection(Territory t1,
Territory t2)
|
protected void |
addTerritory(Territory t1)
|
int |
getDistance(Territory t1,
Territory t2)
Returns the distance between two territories. |
int |
getDistance(Territory t1,
Territory t2,
Match<Territory> cond)
Returns the distance between two territories. |
int |
getLandDistance(Territory t1,
Territory t2)
Returns the distance between two territories on Land. |
Route |
getLandRoute(Territory t1,
Territory t2)
Returns the shortest route between two territories. |
java.util.Set<Territory> |
getNeighbors(Territory t)
Returns a territories neighbors. |
java.util.Set<Territory> |
getNeighbors(Territory territory,
int distance)
Returns all territories within distance from territory, excluding the territory itself. |
java.util.Set<Territory> |
getNeighbors(Territory t,
Match<Territory> cond)
Returns a territories neighbors. |
Route |
getRoute(Territory t1,
Territory t2)
Returns the shortest route between two territories. |
Route |
getRoute(Territory t1,
Territory t2,
Match<Territory> cond)
Returns the shortest route between two territories. |
java.util.Collection<Territory> |
getTerritories()
|
java.util.Collection<Territory> |
getTerritoriesOwnedBy(PlayerID player)
|
Territory |
getTerritory(java.lang.String s)
Return the territory with the given name, or null if no territory can be found. |
Territory |
getTerritoryFromCoordinates(int... coordinate)
|
int |
getWaterDistance(Territory t1,
Territory t2)
Returns the distance between two territories on Water. |
Route |
getWaterRoute(Territory t1,
Territory t2)
Returns the shortest route between two territories. |
int |
getXDimension()
|
int |
getYDimension()
|
boolean |
isCoordinateValid(int... coordinate)
|
boolean |
isValidRoute(Route route)
Tests that each territory is connected to the preceding territory |
java.util.Iterator<Territory> |
iterator()
|
void |
setGridDimensions(int... gridDimensions)
|
| Methods inherited from class games.strategy.engine.data.GameDataComponent |
|---|
getData, readInternal, writeInternal |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Match<Territory> IS_WATER
public static final Match<Territory> IS_LAND
public static final Match<Territory> IS_LAND_OR_WATER
| Method Detail |
|---|
public void setGridDimensions(int... gridDimensions)
public int getXDimension()
public int getYDimension()
public Territory getTerritoryFromCoordinates(int... coordinate)
public boolean isCoordinateValid(int... coordinate)
protected void addTerritory(Territory t1)
protected void addConnection(Territory t1,
Territory t2)
public Territory getTerritory(java.lang.String s)
public java.util.Set<Territory> getNeighbors(Territory t)
public java.util.Set<Territory> getNeighbors(Territory t,
Match<Territory> cond)
public java.util.Set<Territory> getNeighbors(Territory territory,
int distance)
public Route getRoute(Territory t1,
Territory t2)
public Route getLandRoute(Territory t1,
Territory t2)
public Route getWaterRoute(Territory t1,
Territory t2)
public Route getRoute(Territory t1,
Territory t2,
Match<Territory> cond)
public int getDistance(Territory t1,
Territory t2)
public int getLandDistance(Territory t1,
Territory t2)
public int getWaterDistance(Territory t1,
Territory t2)
public int getDistance(Territory t1,
Territory t2,
Match<Territory> cond)
public java.util.Collection<Territory> getTerritories()
public java.util.Iterator<Territory> iterator()
iterator in interface java.lang.Iterable<Territory>public java.util.Collection<Territory> getTerritoriesOwnedBy(PlayerID player)
public boolean isValidRoute(Route route)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||