public class Room extends Object
Constructor and Description |
---|
Room(String description)
Create a room described "description".
|
Modifier and Type | Method and Description |
---|---|
Room |
getExit(String direction)
Return the room that is reached if we go from this room in direction
"direction".
|
Set<String> |
getExitDirections()
Return a set of all of the directions one can exit from this room.
|
String |
getExitString()
Return a string describing the room's exits, for example
"Exits: north west".
|
String |
getLongDescription()
Return a long description of this room, including a list of
available exits.
|
String |
getShortDescription()
Return the description of the room (the one that was defined in the
constructor).
|
void |
setExit(String direction,
Room neighbor)
Define an exit from this room.
|
public Room(String description)
description
- The room's descriptionpublic void setExit(String direction, Room neighbor)
direction
- The direction of the exitneighbor
- The room connected to this one in the given directionpublic String getShortDescription()
public String getLongDescription()
You are in the kitchen. Exits: north west
getExitString()
.public String getExitString()
public Room getExit(String direction)
direction
- The direction to travel