|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.eoi.freya.basic.BasicMap
The BasicMap is a huge 2D array of BasicLocations
Field Summary | |
protected static BasicMap |
mapInstance
|
Constructor Summary | |
protected |
BasicMap()
|
Method Summary | |
org.jdom.Element |
convertToElement()
Converts entire map to an element, filling missing xy's with a blank element. |
void |
createFromElement(org.jdom.Element mapElement)
Given a root element createFromElement fills the map array with the XML data |
static BasicMap |
getInstance()
|
Location |
getLocation(BasicPosition pos)
get the Location object of a give BasicPosition |
Location |
getLocation(int x,
int y)
get the Location object of a give x y spot |
org.jdom.Element |
getMapPortion(int x,
int y,
int width,
int height)
Creates a root element that contains a portion of map as XML |
int |
getMaxX()
|
int |
getMaxY()
|
boolean |
hasUnit(java.lang.String name,
BasicPosition pos)
return true is Location has a give unit at a given x y spot |
boolean |
hasUnit(java.lang.String name,
int x,
int y)
return true is Location has a give unit at a given BasicPosition |
void |
read(java.lang.String filename)
read the map from disk |
void |
setMap(BasicLocation[][] newMap)
|
void |
write(java.lang.String filename)
write the map to disk |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static BasicMap mapInstance
Constructor Detail |
protected BasicMap()
Method Detail |
public static BasicMap getInstance()
public void createFromElement(org.jdom.Element mapElement)
public org.jdom.Element convertToElement()
public org.jdom.Element getMapPortion(int x, int y, int width, int height)
public Location getLocation(int x, int y)
getLocation
in interface Map
public Location getLocation(BasicPosition pos)
public boolean hasUnit(java.lang.String name, BasicPosition pos)
public boolean hasUnit(java.lang.String name, int x, int y)
public void write(java.lang.String filename)
write
in interface Map
public void read(java.lang.String filename)
read
in interface Map
public void setMap(BasicLocation[][] newMap)
public int getMaxX()
public int getMaxY()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |