Room - p public class Room cfw_ private private private...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
p public class Room { p private String description; private boolean north; private boolean south; private boolean east; private boolean west; private boolean isDark; p private Lamp theLamp; private Key theKey; private Chest theChest; p /** * Returns the text description of this room */ public String getDescription() { return description; } /** * Returns true if the player can go north from this room */ public boolean canGoNorth() { return north; } /** * Returns true if the player can go south from this room */ public boolean canGoSouth() { return south; } /** * Returns true if the player can go east from this room */ public boolean canGoEast() { return east; } /** * Returns true if the player can go west from this room */ public boolean canGoWest() { return west; } /** * Returns the lamp object in this room. * If no lamp is present, returns null */ public Lamp getLamp() { return theLamp; } /** * Sets the lamp variable in this room to null
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
*/ public void clearLamp() { theLamp = null; } /** * Returns the key object in this room.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

Room - p public class Room cfw_ private private private...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online