|
||||||||||
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 |
RpgMapPoint |
getBottomRight()
Get coordinates of Bottom/Right map point (w,h) |
Cell |
getCell(Cell from,
Direction to)
Get RpgMapCell that is located in direction 'to' starting from 'from' Cell |
Cell |
getCell(HexPoint p)
Get 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 RpgMapMethod Detail |
---|
public java.util.Random getRandomSeed()
public MapIterator iterator()
iterator
in interface ILogicalMap
public short getWidth()
getWidth
in interface ILogicalMap
public short getHeight()
getHeight
in interface ILogicalMap
public RpgMapPoint getRandomPoint()
public Cell getRandomCell()
public boolean isInside(RpgMapPoint p)
isInside
in interface ILogicalMap
p
- 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
JurpeException
public Cell getSpecialCell(LocationType type)
type
- Special cell type
public RpgMapPoint getTopLeft()
getTopLeft
in interface ILogicalMap
public RpgMapPoint getBottomRight()
getBottomRight
in interface ILogicalMap
public 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(HexPoint p)
getCell
in interface ILogicalMap
p
- HexPoint
public Cell getCell(short x, short y)
x
- x coordinatey
- y coordinate HexPoint
public Cell getCell(Cell from, Direction to)
from
- Initial RpgMapCellto
- Direction to go to
|
Jurpe - Java Universal Role Playing Engine - http://jurpe.sourceforge.net | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |