jurpe.dungeon.rpgmap
Class Passage

java.lang.Object
  extended by jurpe.dungeon.rpgmap.Passage
All Implemented Interfaces:
java.io.Serializable

public class Passage
extends java.lang.Object
implements java.io.Serializable

Passage is an open or closed passage between two RPGMAP cells. Can contain a door or not.

See Also:
Serialized Form

Constructor Summary
Passage(Direction dir)
          Constructor.
 
Method Summary
 Direction getDirection()
          Return the direction of this passage.
 Door getDoor()
          Get door, if any, in this passage
 boolean hasDoor()
          If this passage has a door it will return true
 boolean isClosed()
          Returns true if this passage is closed
 boolean isOpened()
          Returns true if this passage is opened
 void setClosed()
          Set the passage closed
 void setDoor(Door door)
          Set a door in this passage
 void setOpen()
          Set the passage open
 void setOpen(boolean open)
          Set the passage open
 java.lang.String toString()
          A representation of the passage: O = opened C = closed If the passage has a door, a representation of the door is added
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Passage

public Passage(Direction dir)
Constructor. Defaults to open passage.

Method Detail

getDirection

public Direction getDirection()
Return the direction of this passage. The direction is always relative to the center of the cell

Returns:
Direction of the passage

isClosed

public boolean isClosed()
Returns true if this passage is closed

Returns:
true if this passage is closed

isOpened

public boolean isOpened()
Returns true if this passage is opened

Returns:
True if this passage is opened

setClosed

public void setClosed()
Set the passage closed


setOpen

public void setOpen()
Set the passage open


setOpen

public void setOpen(boolean open)
Set the passage open

Parameters:
open - If this passage is open, set to true

setDoor

public void setDoor(Door door)
Set a door in this passage


getDoor

public Door getDoor()
Get door, if any, in this passage

Returns:
Door in this passage. Null if there is no door.

hasDoor

public boolean hasDoor()
If this passage has a door it will return true

Returns:
True, if this passage has a door

toString

public java.lang.String toString()
A representation of the passage: O = opened C = closed If the passage has a door, a representation of the door is added

Overrides:
toString in class java.lang.Object

Jurpe - Java Universal Role Playing Engine - http://jurpe.sourceforge.net