public class Room
extends java.lang.Object
Constructor and Description |
---|
Room(java.lang.String description)
Create a room described "description".
|
Modifier and Type | Method and Description |
---|---|
Room |
getExit(java.lang.String direction)
Return the room that is reached if we go from this room in direction
"direction".
|
java.util.Set<java.lang.String> |
getExitDirections()
Return a set of all of the directions one can exit from this room.
|
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, including a list of
available exits.
|
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.
|
public Room(java.lang.String description)
description
- The room's descriptionpublic void setExit(java.lang.String direction, Room neighbor)
direction
- The direction of the exitneighbor
- The room connected to this one in the given directionpublic java.lang.String getShortDescription()
public java.lang.String getLongDescription()
You are in the kitchen. Exits: north west
getExitString()
.public java.lang.String getExitString()
public Room getExit(java.lang.String direction)
direction
- The direction to travelpublic java.util.Set<java.lang.String> getExitDirections()