Class Room.RoomPassage

java.lang.Object
  |
  +--Room.RoomPassage
Enclosing class:
Room

class Room.RoomPassage
extends java.lang.Object

This inner class allows us to encapsulate information about a Passage and its relationship with the current Room. Because it's a intended primarily as a structure (with some convenience methods), the instance variables are not protected.

See Also:
Passage

Field Summary
(package private)  java.lang.String direction
          Direction, such as "north" or "uphill"
(package private)  boolean locked
          For future use
(package private)  Passage passage
          The Passage which connects us with another Room
 
Constructor Summary
(package private) Room.RoomPassage(Passage argPassage, java.lang.String argDirection)
          The constructor should be called only from the Passage constructor.
 
Method Summary
 java.lang.String getLongDescription()
          Get a longer description for use in other displays
 Room getOuterReference()
          Find out what Room we're part of.
 java.lang.String toString()
          Get a string representation of the object
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

direction

java.lang.String direction
Direction, such as "north" or "uphill"

locked

boolean locked
For future use

passage

Passage passage
The Passage which connects us with another Room
Constructor Detail

Room.RoomPassage

Room.RoomPassage(Passage argPassage,
                 java.lang.String argDirection)
The constructor should be called only from the Passage constructor. Initializes instance variables and adds us to the Room's list of passages.
Parameters:
argPassage - the passage that this connects to
argDirection - the direction that it goes from here
Method Detail

getLongDescription

public java.lang.String getLongDescription()
Get a longer description for use in other displays
Returns:
The Room name and direction

getOuterReference

public Room getOuterReference()
Find out what Room we're part of.
Returns:
the Room

toString

public java.lang.String toString()
Get a string representation of the object
Overrides:
toString in class java.lang.Object
Returns:
the direction only, so some utilities for finding stuff by name work well.