|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjurpe.dungeon.rpgmap.Cell
public class Cell
Cell is the logical abstraction of a dungeon cell. A cell contains six passages. A cell with six passages closed is a wall. Can contain doors and other furnishing.
| Field Summary | |
|---|---|
boolean |
visited
|
| Constructor Summary | |
|---|---|
Cell(short xx,
short yy)
Constructor |
|
Cell(short xx,
short yy,
LocationType location)
Constructor |
|
| Method Summary | |
|---|---|
RpgMapPoint |
getCoordinates()
Get cell coordinates |
Direction[] |
getDoorables()
Return all the directions in which this cell may have a door. |
Direction[] |
getDoors()
Get all directions in whose there are doors. |
Location |
getLocation()
|
short |
getNumberOfCorridors()
Get the number of open corridors leading out of this cell. |
CellPassages |
getPassages()
The passages from this cell |
boolean |
isCorridor(Direction dir)
Return true if the passage between this cell and the cell in d direction is a corridor, that is, it's opened. |
boolean |
isDoor(Direction dir)
Return true if there is a door in the direction dir |
boolean |
isSpecial()
Return true if this cell is not a wall or a corridor. |
boolean |
isWall()
A cell without exits is considered a wall |
void |
setCorridor(Direction dir,
boolean opened)
Set if the passage between this cell and the cell in d direction is opened |
void |
setDoor(Direction dir)
Set a door. |
void |
setLocation(LocationType location)
Set location type |
void |
setLocation(LocationType location,
java.lang.String message)
Set location type and message. |
void |
setWall()
This cell becomes a wall. |
void |
setWall(boolean isWall)
Determine if this cell is a wall or not |
java.lang.String |
toString()
String with cell coordinates |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public boolean visited
| Constructor Detail |
|---|
public Cell(short xx,
short yy)
xx - X coordinate of cellyy - Y coordinate of cell
public Cell(short xx,
short yy,
LocationType location)
xx - X coordinate of cellyy - Y coordinate of celllocation - type of this cell (ie: inn, trainer, normal...)| Method Detail |
|---|
public CellPassages getPassages()
public Location getLocation()
public void setLocation(LocationType location)
location - LocationType
public void setLocation(LocationType location,
java.lang.String message)
message - Message shown when selecting locationlocation - LocationTypepublic boolean isSpecial()
public RpgMapPoint getCoordinates()
public boolean isWall()
public void setWall()
public void setWall(boolean isWall)
isWall - true if this cell is a wall
public Direction[] getDoors()
throws JurpeException
JurpeExceptionpublic void setDoor(Direction dir)
dir - Direction
public Direction[] getDoorables()
throws JurpeException
JurpeExceptionpublic boolean isCorridor(Direction dir)
dir - Direction adiacent cell
public boolean isDoor(Direction dir)
dir - Direction in which looking for a door
public void setCorridor(Direction dir,
boolean opened)
dir - Direction from the centeropened - true if the passage in this direction is openedpublic short getNumberOfCorridors()
public java.lang.String toString()
toString in class java.lang.Object
|
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 | |||||||||