java.lang.ObjectRoom
public class Room
Represents a room in the game
Constructor Summary | |
---|---|
Room(java.lang.String description)
Constructor for objects of type Room |
Method Summary | |
---|---|
void |
addItem(Item newItem)
Adds a new item to the room |
java.lang.String |
getDescription()
Returns the description of the room |
Item |
getItem(java.lang.String description)
Returns the item with a specified description |
Item[] |
getItems()
Returns the items in the room |
boolean |
removeItem(java.lang.String description)
Removes the specified item from the room |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Room(java.lang.String description)
description
- a description of the roomMethod Detail |
---|
public void addItem(Item newItem)
newItem
- the item to addpublic java.lang.String getDescription()
public Item getItem(java.lang.String description)
description
- the description of the specified item
public Item[] getItems()
public boolean removeItem(java.lang.String description)
description
- the description of the specified item