|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectRoom
public class Room
Class Room - a room in an adventure game. This class is part of the "World of Zuul" application. "World of Zuul" is a very simple, text based adventure game. A "Room" represents one location in the scenery of the game. It is connected to other rooms via exits. For each existing exit, the room stores a reference to the neighboring room.
Field Summary | |
---|---|
private java.lang.String |
description
|
private java.util.HashMap<java.lang.String,Room> |
exits
|
Constructor Summary | |
---|---|
Room(java.lang.String description)
Create a room described "description". |
Method Summary | |
---|---|
Room |
getExit(java.lang.String direction)
Return the room that is reached if we go from this room in direction "direction". |
private java.lang.String |
getExitString()
Return a string describing the room's exits, for example "Exits: north west". |
java.lang.String |
getLongDescription()
Return a long description of this room, in the form: You are in the kitchen. |
java.lang.String |
getShortDescription()
Return the description of the room (the one that was defined in the constructor). |
void |
setExit(java.lang.String direction,
Room neighbor)
Define an exit from this room. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String description
private java.util.HashMap<java.lang.String,Room> exits
Constructor Detail |
---|
public Room(java.lang.String description)
Method Detail |
---|
public void setExit(java.lang.String direction, Room neighbor)
public java.lang.String getShortDescription()
public java.lang.String getLongDescription()
private java.lang.String getExitString()
public Room getExit(java.lang.String direction)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |