|
|||||||
| 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.
| Constructor Summary | |
|---|---|
Room(String description)
Create a room described "description". |
|
| Method Summary | |
|---|---|
Room |
getExit(String direction)
Return the room that is reached if we go from this room in direction "direction". |
String |
getLongDescription()
Return a description of the room in the form: You are in the kitchen. |
String |
getShortDescription()
|
void |
setExit(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 |
| Constructor Detail |
|---|
public Room(String description)
description - The room's description.| Method Detail |
|---|
public Room getExit(String direction)
direction - The exit's direction.
public String getLongDescription()
public String getShortDescription()
public void setExit(String direction,
Room neighbor)
direction - The direction of the exit.neighbor - The room to which the exit leads.
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||