|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectadventure.rooms.HallwayRoom
public class HallwayRoom
This is the class for the hallway in the game. It implements Room so it must have the same methods defined as Room does. The hallway has exits to the north and south. However, to go north the player must have acquired the flashlight and turned it on or they will not have the option to go north.
See the Room interface and the GameState class for details about how room objects work.
| Constructor Summary | |
|---|---|
HallwayRoom()
The constructor for the hallway object. |
|
| Method Summary | |
|---|---|
void |
draw(GameState game,
java.awt.Graphics g,
int windowWidth,
int windowHeight)
This is the method for putting the picture associated with this room on display. |
java.lang.String |
getName()
Returns the name of this room object as a String. |
void |
outputDescription(GameState game,
OutputPanel output)
Prints text describing this room to the output panel. |
boolean |
takeAction(GameState game,
OutputPanel output,
java.lang.String verb,
java.lang.String noun)
This is the method that will get called when the player enters valid input for exiting this room. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HallwayRoom()
| Method Detail |
|---|
public java.lang.String getName()
Students may often call this method.
getName in interface Room
public void outputDescription(GameState game,
OutputPanel output)
It would be uncommon for students to call this method.
outputDescription in interface Roomgame - the GameState object that is running / keeping track of this gameoutput - the output panel where text will be added
public boolean takeAction(GameState game,
OutputPanel output,
java.lang.String verb,
java.lang.String noun)
takeAction in interface Roomgame - the GameState object that is running / keeping track of this gameoutput - the output panel where text will be addedverb - the verb of the action, such as "get"noun - the noun of the action, such as "batteries"
public void draw(GameState game,
java.awt.Graphics g,
int windowWidth,
int windowHeight)
draw in interface Roomgame - the GameState object that is running / keeping track of this gameg - the Graphics object to do the drawingwindowWidth - the width of the windowwindowHeight - the height of the window
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||