|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sourceforge.worldsaver.rp.RpBase | +--net.sourceforge.worldsaver.rp.Area
The abstract base class for all areas. There's much implemented in this class, but a specific type of area should extend this class and add some specific information to the new class and the saveable String.
Fields inherited from interface net.sourceforge.worldsaver.util.MiscUtils |
CONSOLE_WIDTH, NEWLINE, RANDOM |
Constructor Summary | |
Area(java.util.HashMap map)
Creates a new area from loaded values. |
|
Area(RpBase father,
java.lang.String name,
int x,
int y)
Creates a new area with a map with x*y tiles, the given name and belonging to the given father. |
Method Summary | |
java.util.ArrayList |
getMap(int x,
int y)
Returns the list of objects that are on a specific location. |
int |
getMapX()
Returns the length of the x-axis of the map. |
int |
getMapY()
Returns the length of the y-axis of the map. |
void |
getReferencesRight(java.util.HashMap pool,
IDGenerator gen)
See RpBase for details. |
java.lang.String |
getSaveableString()
Returns a String which can immediately be saved to disk. |
java.awt.image.BufferedImage |
getVisualization()
Returns a BufferedImage which shows the area. |
void |
setMap(RpBase val,
int x,
int y)
Fills the specified piece of the map with life. |
void |
setMapX(int v)
Resizes the x-axis of the map. |
void |
setMapY(int v)
Resizes the y-axis of the map. |
void |
setVisualization(java.awt.image.BufferedImage val)
Sets the graphical visualization of the area. |
Methods inherited from class net.sourceforge.worldsaver.rp.RpBase |
addChild, addDescription, copy, getChilds, getDescription, getFather, getID, getName, setDescription, setFather, setName |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Area(RpBase father, java.lang.String name, int x, int y)
father
- the father of the new areaname
- the name of the new areax
- the x-axis of the new areay
- the y-axis of the new areapublic Area(java.util.HashMap map)
map
- the valuesRpBase.RpBase(net.sourceforge.worldsaver.rp.RpBase, java.lang.String)
Method Detail |
public void getReferencesRight(java.util.HashMap pool, IDGenerator gen)
getReferencesRight
in interface Saveable
getReferencesRight
in class RpBase
RpBase.getReferencesRight(java.util.HashMap, net.sourceforge.worldsaver.util.IDGenerator)
public java.lang.String getSaveableString() throws java.io.IOException
getSaveableString
in interface Saveable
getSaveableString
in class RpBase
RpBase.getSaveableString()
public int getMapY()
public void setMapY(int v)
v
- the new length of the y-axispublic int getMapX()
public void setMapX(int v)
v
- the new length of the x-axispublic void setVisualization(java.awt.image.BufferedImage val)
val
- the BufferedImage which contains the visualizationpublic void setMap(RpBase val, int x, int y)
val
- the object that shall be addedx
- the x-location of the objecty
- the y-location of the objectpublic java.util.ArrayList getMap(int x, int y)
x
- the x-locationy
- the y-locationpublic java.awt.image.BufferedImage getVisualization()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |