|
Java Universal Role Playing Engine Version 0.3.9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjurpe.dungeon.rpgmap.RpgMap
public class RpgMap
RpgMap is the description of a single map, that is a level in the HexDungeon
| Constructor Summary | |
|---|---|
RpgMap(java.util.Random rnd,
short sizeX,
short sizeY)
Constructor |
|
| Method Summary | |
|---|---|
boolean |
areAllVisitedCells()
Returns true if all cells in the map were visited |
Cell[] |
getAdiacentCells(Cell from)
Get all adiacent cells of cell 'from' |
RpgMapPoint |
getBottomRight()
Get coordinates of Bottom/Right map point (w,h) |
Cell |
getCell(AbstractHexPoint p)
Get Cell |
Cell |
getCell(Cell from,
Direction to)
Get RpgMapCell that is located in direction 'to' starting from 'from' Cell |
Cell |
getCell(short x,
short y)
Get Cell |
RpgMapPoint |
getCenter()
Get the coordinates of the center of this map |
Cell |
getEmptyRandomCell(boolean nextToCenter)
Get a random cell in this map that is not a wall or a special cell. |
short |
getHeight()
Height of RpgMap in Hexagons |
Cell |
getRandomCell()
Get a random cell in this map |
RpgMapPoint |
getRandomPoint()
Get a random point inside this map |
java.util.Random |
getRandomSeed()
Return random seed. |
Cell |
getSpecialCell(LocationType type)
Get the first found cell of the specified location type |
RpgMapPoint |
getTopLeft()
Get coordinates of Top/Left map point (0,0) |
short |
getWidth()
Width of RpgMap in Hexagons |
boolean |
isInside(RpgMapPoint p)
Return true if point p is inside this map. |
MapIterator |
iterator()
Iterator |
RpgMapPoint |
moveTo(RpgMapPoint from,
Direction dir)
This method returns the coordinates of the arrival point when starting from a point a taking a direction. |
void |
setSpecialCell(RpgMapPoint p,
LocationType type)
Set special cell |
void |
setSpecialCell(RpgMapPoint p,
LocationType type,
java.lang.String message)
Set special cell with a message |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RpgMap(java.util.Random rnd,
short sizeX,
short sizeY)
rnd - Random seedsizeX - Width in hexagons of RpgMapsizeY - Height in hexagons of RpgMap| Method Detail |
|---|
public java.util.Random getRandomSeed()
public MapIterator iterator()
iterator in interface java.lang.Iterable<Cell>iterator in interface ILogicalMappublic short getWidth()
getWidth in interface ILogicalMappublic short getHeight()
getHeight in interface ILogicalMappublic RpgMapPoint getRandomPoint()
public Cell getRandomCell()
public boolean isInside(RpgMapPoint p)
isInside in interface ILogicalMapp - RpgPoint to be checked
public void setSpecialCell(RpgMapPoint p,
LocationType type)
throws JurpeException
p - RpgMapPoint to set as specialtype - Location type
JurpeException
public void setSpecialCell(RpgMapPoint p,
LocationType type,
java.lang.String message)
throws JurpeException
message - Message that this cell displays when actionedp - Map pointtype - Type of cell
JurpeExceptionpublic Cell getSpecialCell(LocationType type)
type - Special cell type
public RpgMapPoint getTopLeft()
getTopLeft in interface ILogicalMappublic RpgMapPoint getBottomRight()
getBottomRight in interface ILogicalMappublic boolean areAllVisitedCells()
public RpgMapPoint moveTo(RpgMapPoint from,
Direction dir)
from - Point coordinates of starting hexagondir - Direction taken
public RpgMapPoint getCenter()
public Cell getEmptyRandomCell(boolean nextToCenter)
nextToCenter - if true, it will try to return a cell next to the center of
the dungeon
public Cell getCell(AbstractHexPoint p)
getCell in interface ILogicalMapp - AbstractHexPoint
public Cell getCell(short x,
short y)
x - x coordinatey - y coordinate AbstractHexPoint
public Cell[] getAdiacentCells(Cell from)
throws JurpeException
from - The cell from
JurpeException
public Cell getCell(Cell from,
Direction to)
from - Initial RpgMapCellto - Direction to go to
|
Java Universal Role Playing Engine Version 0.3.9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||