Class Room
java.lang.Object
Room
public class Room
- extends Object
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. The exits are labelled north,
east, south, west. For each direction, the room stores a reference
to the neighboring room, or null if there is no exit in that direction.
- Version:
- 2006.03.30
- Author:
- Michael Kolling and David J. Barnes
Constructor Summary |
Room(String description)
Create a room described "description". |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
description
public String description
eastExit
public Room eastExit
northExit
public Room northExit
southExit
public Room southExit
westExit
public Room westExit
Room
public Room(String description)
- Create a room described "description". Initially, it has
no exits. "description" is something like "a kitchen" or
"an open court yard".
- Parameters:
description
- The room's description.
getDescription
public String getDescription()
- Returns:
- The description of the room.
setExits
public void setExits(Room north,
Room east,
Room south,
Room west)
- Define the exits of this room. Every direction either leads
to another room or is null (no exit there).
- Parameters:
north
- The north exit.east
- The east east.south
- The south exit.west
- The west exit.