Class
Tree
Deprecated
Index
Help
PREV NEXT
FRAMES
NO FRAMES
A
C
D
E
G
H
I
K
L
M
N
P
R
S
T
U
V
W
A
actionPerformed(ActionEvent)
- Method in class
GameGui
Listener for the commandInput text field.
add(Thing)
- Method in class
Room
Puts the given Thing into the room.
addPath(String, Room)
- Method in class
Room
Creates a new path, in the given direction, to the given Room.
C
CommandHandler
- class
CommandHandler
.
The CommandHandler parses command strings (such as "take bucket"), calls the appropriate methods of Player, and returns the result.
CommandHandler()
- Constructor for class
CommandHandler
commandInput
- Variable in class
GameGui
contains(Thing)
- Method in class
Room
Tests whether the given Thing is in this Room.
contents
- Variable in class
Room
contents()
- Method in class
Room
D
description
- Variable in class
Room
description
- Variable in class
Thing
display(String)
- Method in class
GameGui
Displays the given text, with an added newline, in the transcript.
doSomething()
- Method in class
Neandertal
The Neandertal attempts to do something random.
drop(String)
- Method in class
Player
Attempts to drop a Thing being held by the Player.
E
exits()
- Method in class
Room
G
Game
- class
Game
.
The Game class creates the World, a Player in the World, and an instance of the GameGui class, and it makes the GameGui instance visible.
Game()
- Constructor for class
Game
GameGui
- class
GameGui
.
The GameGUI class provides the GUI for an adventure game, including basic input/output operations, but does not handle game logic of any sort.
GameGui.Close
- class
GameGui.Close
.
Terminates the application when the window is closed.
GameGui.Close(GameGui)
- Constructor for class
GameGui.Close
GameGui()
- Constructor for class
GameGui
Constructor for the Game GUI.
getDescription()
- Method in class
Room
Returns the full description of this Room.
getDescription()
- Method in class
Thing
getMyLocation()
- Method in class
Player
Returns this Player's current Room.
getRoom(String)
- Static method in class
Room
getThing(String)
- Static method in class
Thing
getVisible()
- Method in class
Thing
go(String)
- Method in class
Player
Attempts to move the Player to an adjoining Room in the indicated direction.
gorgo
- Static variable in class
Game
gui
- Static variable in class
Game
H
handleCommand(Player, String)
- Static method in class
CommandHandler
Given a Player and a command, this routine parses the command and calls the appropriate method of the Player; the result of the call is returned as a string.
handler
- Static variable in class
Game
help()
- Static method in class
CommandHandler
Returns a list of available commands.
I
inventory()
- Method in class
Player
Returns a String describing the Things that are in the user's "inventory" (the things the user is holding).
isPath(String)
- Method in class
Room
Tests whether there is a path from this Room in the indicated direction.
K
Key
- class
Key
.
Write a description of class Key here.
Key(String)
- Constructor for class
Key
Constructor for objects of class Key.
L
location
- Variable in class
Player
look()
- Method in class
Player
Returns information about the user's current location.
look(String)
- Method in class
Player
Attempts to look at a Thing that is either being held by the Player or is in the same Room as the Player.
M
main(String[])
- Static method in class
Game
Gets things started
makeWorld()
- Static method in class
World
Create the world.
maybeDropSomething()
- Method in class
Neandertal
If the Neandertal is holding Things, then approximately half the time it will drop something.
maybeMove()
- Method in class
Neandertal
The Neandertal attempts to move in some random direction.
maybeTakeSomething()
- Method in class
Neandertal
If there are Things here, then approximately half the time the Neandertal will take something.
N
name
- Variable in class
Neandertal
name
- Variable in class
Room
name
- Variable in class
Thing
Neandertal
- class
Neandertal
.
This class represents a Neandertal who wanders around in the game doing some random things.
Neandertal(String, Room)
- Constructor for class
Neandertal
Constructor for Neandertals.
nextRoom(String)
- Method in class
Room
Returns the Room that will be reached if you go in the given direction from this Room.
P
paths
- Variable in class
Room
player
- Static variable in class
Game
Player
- class
Player
.
A Player object represents the person playing the game.
Player(Room)
- Constructor for class
Player
Constructor for the (single) object of class Player.
R
random
- Variable in class
Neandertal
remove(Thing)
- Method in class
Room
Removes the given Thing from this Room.
removePath(String)
- Method in class
Room
Removes the path going from this Room in the given direction.
Room
- class
Room
.
A Room is a "location" in the adventure game.
Room(String)
- Constructor for class
Room
Constructor for objects of class Room.
rooms
- Static variable in class
Room
S
saveTranscript()
- Method in class
GameGui
Saves the game transcript to a file specified by the user.
setDescription(String)
- Method in class
Room
Replaces the description of this Room with something more appropriate.
setDescription(String)
- Method in class
Thing
Replaces the description of this Thing with something more appropriate.
setVisible(boolean)
- Method in class
Thing
Marks the thing visible if the parameter is true, or invisible if the parameter is false.
startingLocation
- Static variable in class
World
T
take(String)
- Method in class
Player
Attempts to pick up a Thing from the Room that this Player is in.
Thing
- class
Thing
.
A "Thing" is an object in the adventure game.
Thing(String)
- Constructor for class
Thing
Constructor for objects of class Thing.
thingIterator()
- Method in class
Room
Returns an iterator for the Things in the room.
things
- Static variable in class
Thing
thingsIAmHolding
- Variable in class
Player
toString()
- Method in class
Neandertal
Returns the Neandertal's name.
toString()
- Method in class
Room
Returns the name of this Room.
toString()
- Method in class
Thing
transcript
- Variable in class
GameGui
U
use(Player, Room)
- Method in class
Key
Lock or unlock the house door, if the Player is outside
use(Player, Room)
- Method in class
Thing
Does nothing and returns a message saying that this Thing is useless.
use(String)
- Method in class
Player
Attempts to use a Thing being held by the Player.
V
visible
- Variable in class
Thing
W
windowClosing(WindowEvent)
- Method in class
GameGui.Close
world
- Static variable in class
World
World
- class
World
.
This class represents the whole world.
World()
- Constructor for class
World
Constructor for objects of class World.
A
C
D
E
G
H
I
K
L
M
N
P
R
S
T
U
V
W
Class
Tree
Deprecated
Index
Help
PREV NEXT
FRAMES
NO FRAMES