|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrails.game.MapManager
public class MapManager
MapManager configures the map layout from XML
Field Summary | |
---|---|
protected MapHex[][] |
hexes
|
protected boolean |
letterAHasEvenNumbers
|
protected boolean |
lettersGoHorizontal
|
protected static org.apache.log4j.Logger |
log
|
protected int |
maxCol
|
protected int |
maxRow
|
protected int |
maxX
|
protected int |
maxY
|
protected java.util.Map<java.lang.String,MapHex> |
mHexes
|
protected int |
minCol
|
protected int |
minRow
|
protected int |
minX
|
protected int |
minY
|
protected java.util.SortedSet<java.lang.Integer> |
possibleTileCosts
|
protected int |
tileOrientation
|
protected static int[] |
xDeltaNS
|
protected static int[] |
xYEvenDeltaEW
|
protected static int[] |
xYOddDeltaEW
|
protected static int[] |
yDeltaEW
|
protected static int[] |
yXEvenDeltaNS
|
protected static int[] |
yXOddDeltaNS
|
Constructor Summary | |
---|---|
MapManager()
|
Method Summary | |
---|---|
void |
configureFromXML(Tag tag)
Instructs the component to configure itself from the provided XML element. |
void |
finishConfiguration(GameManagerI gameManager)
This method is intended to be called for each configurable component, to perforn any initialisation activities that require any other components to be initialised first. |
int |
getAdjacentX(int x,
int y,
int orientation)
|
int |
getAdjacentY(int x,
int y,
int orientation)
|
int[] |
getCityDistances(MapHex hex)
Calculate the distances between a given tokenable city hex and all other tokenable city hexes. |
java.util.List<City> |
getCurrentStations()
|
MapHex |
getHex(java.lang.String locationCode)
|
int |
getHexDistance(MapHex hex1,
MapHex hex2)
Calculate the distance between two hexes as in 1835, i.e. |
MapHex[][] |
getHexes()
|
java.util.List<MapHex> |
getHexesAsList()
|
java.lang.String |
getMapUIClassName()
|
int |
getMaxCol()
|
int |
getMaxRow()
|
int |
getMaxX()
|
int |
getMaxY()
|
int |
getMinCol()
|
int |
getMinRow()
|
int |
getMinX()
|
int |
getMinY()
|
java.util.SortedSet<java.lang.Integer> |
getPossibleTileCosts()
|
int |
getTileOrientation()
|
boolean |
letterAHasEvenNumbers()
|
boolean |
lettersGoHorizontal()
|
java.util.List<MapHex> |
parseLocations(java.lang.String locationCodes)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int tileOrientation
protected boolean lettersGoHorizontal
protected boolean letterAHasEvenNumbers
protected MapHex[][] hexes
protected java.util.Map<java.lang.String,MapHex> mHexes
protected int minX
protected int minY
protected int maxX
protected int maxY
protected int minCol
protected int maxCol
protected int minRow
protected int maxRow
protected java.util.SortedSet<java.lang.Integer> possibleTileCosts
protected static final int[] xDeltaNS
protected static final int[] yXEvenDeltaNS
protected static final int[] yXOddDeltaNS
protected static final int[] xYEvenDeltaEW
protected static final int[] xYOddDeltaEW
protected static final int[] yDeltaEW
protected static org.apache.log4j.Logger log
Constructor Detail |
---|
public MapManager()
Method Detail |
---|
public void configureFromXML(Tag tag) throws ConfigurationException
ConfigurableComponentI
configureFromXML
in interface ConfigurableComponentI
ConfigurationException
rails.game.ConfigurableComponentI#configureFromXML(org.w3c.dom.Element)
public void finishConfiguration(GameManagerI gameManager) throws ConfigurationException
ConfigurableComponentI
This method should be called where necessary after all XML file parsing has completed, so that all objects that need to be related to do exist.
finishConfiguration
in interface ConfigurableComponentI
gameManager
- The 'parent' configurable component is passed to allow
the 'child' to access any other object without the need to resort to
static calls where possible.
ConfigurationException
public boolean letterAHasEvenNumbers()
public boolean lettersGoHorizontal()
public int getAdjacentX(int x, int y, int orientation)
public int getAdjacentY(int x, int y, int orientation)
public int getTileOrientation()
public MapHex[][] getHexes()
public java.util.List<MapHex> getHexesAsList()
public int getMinX()
public int getMinY()
public int getMaxX()
public int getMaxY()
public int getMaxCol()
public int getMaxRow()
public int getMinCol()
public int getMinRow()
public java.lang.String getMapUIClassName()
public MapHex getHex(java.lang.String locationCode)
public java.util.List<City> getCurrentStations()
public java.util.SortedSet<java.lang.Integer> getPossibleTileCosts()
public java.util.List<MapHex> parseLocations(java.lang.String locationCodes) throws ConfigurationException
ConfigurationException
public int getHexDistance(MapHex hex1, MapHex hex2)
hex1
- hex2
-
public int[] getCityDistances(MapHex hex)
The array is cached, so it need be calculated only once.
hex
- Start hex
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |