A B C D E F G H I K L M N O P R S T U V W
A
- actionPerformed(ActionEvent) -
Method in class SaveListener
- Call utility routine to save the text
- Animal - class Animal.
- Animals wander and also eat.
- Animal() -
Constructor for class Animal
-
- announce(GameObject, String) -
Method in class MasterGame
- Add an object's message to the current game state.
- announce(String) -
Method in class GameObject
- If an object wants to say something, let the game handle it.
- announce(String) -
Method in class MasterGame
- Add a message to the current game state for later display.
B
- byeCount -
Variable in class Toddler
- How many more turns to wave byebye
- byeMessage -
Variable in class Toddler
- Message to display each turn.
C
- cancel() -
Method in class SpyThread
- Called from a cancel button and causes us to stop spying
and go home.
- canLeave(RealObject, Room.RoomPassage) -
Method in class Room
- If somebody tries to leave, get consent from all residents
via the checkLeave() method.
- CantCreateObjectException - exception CantCreateObjectException.
- Thrown during initialization when a problem prevents the creation
of an object specified in the input file.
- CantCreateObjectException(String) -
Constructor for class CantCreateObjectException
-
- CantFindObjectException - exception CantFindObjectException.
- Thrown if we're trying to find an object and it's not there.
- CantFindObjectException(String) -
Constructor for class CantFindObjectException
-
- Cat - class Cat.
- A Cat has no special functionality, but is a non-vegetarian with non-zero mobility.
- Cat() -
Constructor for class Cat
- Sets instance variables in superclass.
- CheckContains - class CheckContains.
- Check if one object contains another
- CheckContains() -
Constructor for class CheckContains
-
- checkLeave(GameObject.LeaveInfo) -
Method in class RealObject
- Checks if we're okay about somebody leaving the room we're in.
- CheckNeighbor - class CheckNeighbor.
- Checks whether two objects are in the same room
- CheckNeighbor() -
Constructor for class CheckNeighbor
-
- CheckWithin - class CheckWithin.
- Check whether one object is inside another
- CheckWithin() -
Constructor for class CheckWithin
-
- CheckYes - class CheckYes.
- A class whose
evaluate method always returns
true, to be used as a terminating case when searching. - CheckYes() -
Constructor for class CheckYes
-
- clone() -
Method in class RealObject
- Clone myself and register as necessary.
- compareTo(Object) -
Method in class GameObject
- Compare this object to another, for sorting purposes.
- contents -
Variable in class RealObject
- List of other objects contained within this one.
D
- descendantMessage(RealObject) -
Method in class RealObject.ContentsMessager
- This is why we created this class in the first place,
but it doesn't do anything! Well, the subclasses do.
- destination -
Variable in class Passage
- the other arbitrary endpoint of the passage.
- direction -
Variable in class Room.RoomPassage
- Direction, such as "north" or "uphill"
- doAction() -
Method in class GameObject
- Figure out what we want to do when we get our 15 microseconds
of fame.
- doAction() -
Method in class RealObject
- Figure out what we want to do when we get our 15 microseconds
of fame.
- doAction() -
Method in class Room
- This method makes a big deal out of itself, putting rows
of asterisks above and below its message.
- doAction() -
Method in class Wanderer
- Tell where we are, because it changes, then
with a probability determined by our mobility, randomly head off in some direction,
unless we're inside something.
- doAction() -
Method in class Animal
- If we're hungry enough, search the room for a food item and eat it if it matches
our diet.
- doAction() -
Method in class Mouse
- If we're in a trap (or other object), escape with 1/3 probability; otherwise do
what the super says to.
- doAction() -
Method in class Vines
- Take the default action, then make us a bit more likely to spread or ensnarl.
- doAction() -
Method in class Toddler
- If somebody left recently, continue to wave byebye; otherwise, do superclass action.
- doAction() -
Method in class Dog
- If we want to follow something, do so; otherwise do superclass action.
- doAction() -
Method in class Passage
- Remind the world that we exist and where we go
- Dog - class Dog.
- A Dog can follow something that leaves the room and follow directions.
- Dog() -
Constructor for class Dog
- Sets mobility to only .07 because the faithful Dog will usually stay put unless
it has a good reason to go.
E
- eaten -
Variable in class Animal
- This is a temporary variable used only in doAction and its anonymous inner class,
but it would be a lot of effort and inconvenience to encapsulate it, so I didn't.
- eatMe() -
Method in interface Food
- Somebody's eating me.
- eatMe() -
Method in class Mouse
- If we get eaten, squeal and go away.
- eatMe() -
Method in class FoodHunk
- Decrement the number of pieces and maybe go away.
- Ensnarler - class Ensnarler.
- Objects that grab other objects as they're trying to leave the room.
- Ensnarler() -
Constructor for class Ensnarler
-
- ensnarlMessage -
Variable in class Ensnarler
- Try to grab things when they leave.
- ensnarlRate -
Variable in class Ensnarler
- What is the chance that we will go for it? Ranges from 0 to 1.
- enter(RealObject) -
Method in class Room
- When somebody comes in, add to our list of residents and let
all the previous residents know.
- evaluate(RealObject, String) -
Method in class Predicate
- Evaluate a predicate on an object.
- evaluate(RealObject, String) -
Method in class CheckYes
- Indicates whether the compiler and run-time library are
working properly.
- evaluate(RealObject, String) -
Method in class ObjectPredicate
- Evaluates a predicate given two objects.
- evaluateObject(RealObject, RealObject) -
Method in class ObjectPredicate
- Evaluates a predicate given two objects
- evaluateObject(RealObject, RealObject) -
Method in class CheckNeighbor
- Is this object in the same room as a specified other object?
- evaluateObject(RealObject, RealObject) -
Method in class CheckWithin
- Is this object within a specified other object?
- evaluateObject(RealObject, RealObject) -
Method in class CheckContains
- Does this object contain a specified other object?
F
- fc -
Static variable in class Utility
- We keep a file chooser sitting around to preserve the user's
preferences.
- fileSave(String, String) -
Static method in class Utility
- Save a string into a file.
- findByName(String) -
Method in class MyVector
- Find an element in the vector given its name
- findObjectByName(String) -
Method in class MasterGame
- Given the name of an object, find it.
- findPassageByDirection(String) -
Method in class Room
- Given a direction, find the passage that goes that way, if any.
- followInfo -
Variable in class Dog
- Keep track of what we're going to follow and where.
- Food - interface Food.
- Things that can be eaten
- FoodHunk - class FoodHunk.
- This class implements food objects that when you eat them, they continue to exist, but
get smaller.
- FoodHunk() -
Constructor for class FoodHunk
-
- formatter -
Variable in class Horolog
- a date formatter built from the initializer specifications
G
- GameException - exception GameException.
- Miscellaneous exceptions generated by the GameObject and MasterGame
hierarchies
- GameException(String) -
Constructor for class GameException
- Simple constructor
- gameFile -
Variable in class GenerationGame
- the file to be read to establish the initial game position
- GameObject - class GameObject.
- This is the main class of objects in the game.
- GameObject.LeaveInfo - class GameObject.LeaveInfo.
- This inner class has no methods, but is used as a convenient
way to keep all the information about someone leaving a Room
in one convenient place.
- GameObject.LeaveInfo(GameObject, RealObject, Room.RoomPassage) -
Constructor for class GameObject.LeaveInfo
- Constructor copies arguments into instance variables
- GameObject() -
Constructor for class GameObject
-
- GameWindow - class GameWindow.
- This is the main window through which the user interacts with the
game.
- GameWindow(GenerationGame, String, boolean) -
Constructor for class GameWindow
- Drop controls into the window and display it.
- GenerationGame - class GenerationGame.
- A generation game is any game in which there is a game status which
changes autonomously in steps, called generations.
- GenerationGame() -
Constructor for class GenerationGame
- The no-argument constructor should not be used.
- GenerationGame(String[]) -
Constructor for class GenerationGame
- Creates a game.
- generationInfo -
Variable in class MasterGame
- A string used by
announce to collect information on what's happening.
- getCalories() -
Method in interface Food
- How fattening is this?
- getCalories() -
Method in class Mouse
- How many calories are we?
- getCalories() -
Method in class FoodHunk
- Accessor for calories.
- getLongDescription() -
Method in class RealObject
- What's our long description? Often overridden by subclasses.
- getLongDescription() -
Method in class Room.RoomPassage
- Get a longer description for use in other displays
- getLongDescription() -
Method in class Outside
- Add the weather to the Room's normal long description.
- getLongDescription() -
Method in class FoodHunk
- Construct a varying long description.
- getLongDescription() -
Method in class Horolog
- Use the regular long description for the object but substitute the formatted time
for an at sign.
- getMasterGame() -
Static method in class GameObject
- Retrieve a class variable so we can find the master game object.
- getNextName(String) -
Method in class MasterGame
- Generate an unused name with a given alphabetic beginning
- getOuterReference() -
Method in class Room.RoomPassage
- Find out what Room we're part of.
- getParent() -
Method in class RealObject
- Find out what we're in.
- getResult() -
Method in class SelectWindow
- After a selection has been made, let the user obtain the result.
- getShortDescription() -
Method in class RealObject
- Unregister this object from everything.
- getSpreadability() -
Method in class RealObject
- Find out how likely this object is to spread to another Room.
- getSpreadability() -
Method in class Vines
- Tell how likely we are to spread this turn.
- getTime() -
Method in class MasterGame
- What time do we have?
- goodbye(GameObject.LeaveInfo) -
Method in class RealObject
- Called when somebody leaves the room we're in.
- goodbye(GameObject.LeaveInfo) -
Method in class Toddler
- Notice somebody leaving and start waving byebye.
- goodbye(GameObject.LeaveInfo) -
Method in class Dog
- If something leaves the room, then with a 60% chance we will make a note to follow it
at our next turn.
- growth -
Variable in class Vines
- How likely we are to spread on a given turn.
H
- hello(RealObject) -
Method in class RealObject
- Called when somebody enters the room we're in.
- hello(RealObject) -
Method in class Trap
- Check if the enterer's class is what we're looking for and if so, make us its parent.
- Horolog - class Horolog.
- This class displays the current game time as part of its description.
- Horolog() -
Constructor for class Horolog
-
- hunger -
Variable in class Animal
- How hungry are we? 0.0 means not at all; 100.0 means we'll try every turn.
I
- initialize(String, GameObject) -
Method in class GameObject
- Initalize the object based on details in the input file,
including registering it with the game and its parent.
- initialize(String, GameObject) -
Method in class RealObject
- Initialize this object.
- initialize(String, GameObject) -
Method in class Wanderer
- Initialize a Wanderer with the usual arguments, plus mobility
- initialize(String, GameObject) -
Method in class Trap
- The usual initialization
- initialize(String, GameObject) -
Method in class Ensnarler
- The usual initialization
- initialize(String, GameObject) -
Method in class FoodHunk
- This is a somewhat standard
initialize method, but it makes use
of a specially-formatted longDescription of the form
calories ; pieces ; vegetarian,
where calories indicates the number of calories per piece,
pieces is the number of times this can be eaten before disappearing, and
vegetarian is either "true" or "false"--we look only at the first character
to see if it's 't'.
- initialize(String, GameObject) -
Method in class Horolog
- Initialize with the usual arguments, plus mobility
- initialize(String, GameObject) -
Method in class Passage
- Initialize a passage.
- ioException(String, IOException) -
Method in class RealObject.DescriptionLineProcessor
- Called when file reader gets an IO error.
- ioException(String, IOException) -
Method in interface LineProcessor
- Called when the driver gets an IO exception processing a
file.
- isPredicate(String) -
Method in class RealObject
- Check if a condition applies to this object.
- isVegetarian() -
Method in interface Food
- Is this vegetarian? There's no way to distinguish vegan
from stuff with milk, or chicken from red meat.
- isVegetarian() -
Method in class Mouse
- I don't think vegetarians can eat mice.
- isVegetarian() -
Method in class FoodHunk
- Is this thing veggie?
K
- kill() -
Method in class GameObject
- Remove this object from the game by notifying the master game.
L
- leave(RealObject, Room.RoomPassage) -
Method in class Room
- When somebody leaves, forget about them and let everyone
know (via the goodbye() method) so they can wave bye-bye.
- leavePassage -
Variable in class GameObject.LeaveInfo
- How are they going?
- leaver -
Variable in class GameObject.LeaveInfo
- Who's leaving?
- LineProcessor - interface LineProcessor.
- Specification for file processing callbacks.
- listen(String) -
Method in class GameObject
- Listen to a message and respond.
- listen(String) -
Method in class Dog
- If the command is "go somewhere," try to go in that direction.
- locked -
Variable in class Room.RoomPassage
- For future use
- longDescription -
Variable in class RealObject
- A long description of the object, more or less.
M
- main(String[]) -
Static method in class MasterGame
- Create a game and play it
- masterGame -
Static variable in class GameObject
- The MasterGame object that's running the game of which we're part.
- MasterGame - class MasterGame.
- This is the class that runs everything
- MasterGame(String[]) -
Constructor for class MasterGame
- Create the game and do some initial bookkeeping
- masterTime -
Variable in class MasterGame
- The game time, unrelated to the real clock time
- mobility -
Variable in class Wanderer
- Mobility ranges from 0.0 (stuck in the mud) to 1.0 (move every turn)
- Mouse - class Mouse.
- The Mouse can escape from the trap and also is Food for the Cat.
- Mouse() -
Constructor for class Mouse
- Set instance variables
- myFrame -
Static variable in class Utility
- frame to be used as a default parent where needed.
- myObject -
Variable in class RealObject.ContentsMessager
-
- MyVector - class MyVector.
- Adds methods to pick elements from a vector
- MyVector(int) -
Constructor for class MyVector
- Mimic the superclass constructor
N
- name -
Variable in class GameObject
- Object names are supposed to be unique, but this is not currently enforced.
- newInstance(String, String, GameObject) -
Static method in class GameObject
- Create a new GameObject based on text information.
- next() -
Method in class GenerationGame
- Run the next generation
- next() -
Method in class MasterGame
- Move to the next generation by incrementing the time and
letting all of our objects do something.
- noSuchFile(String) -
Method in class RealObject.DescriptionLineProcessor
- Called when we tried to process a nonexistent file.
- noSuchFile(String) -
Method in interface LineProcessor
- Called when the driver is unable to open a file.
O
- ObjectPredicate - class ObjectPredicate.
- The top of a subtree of classes which evaluate predicates on one
object with respect to a second object.
- ObjectPredicate() -
Constructor for class ObjectPredicate
-
- objects -
Variable in class SelectWindow
- A sorted list of the objects in the original vector.
- objects -
Variable in class MasterGame
- A list of all the objects in the game
- okay -
Variable in class GameObject.LeaveInfo
- Whether it's okay for them to actually leave.
- okay -
Variable in class SpyThread
- When this becomes false (via
cancel, we're done.
- origin -
Variable in class Passage
- an arbitrary endpoint of the passage
- otherEnd(Room) -
Method in class Passage
- What's at our other end? (If you create a subclass with multi-ended Passages, this
method needs to be overridden.
- Outside - class Outside.
- A kind of Room intended for things that are exposed to the weather,
which they tell us about in the long description.
- Outside() -
Constructor for class Outside
-
P
- parentObject -
Variable in class RealObject
- The object we're contained within.
- passage -
Variable in class Room.RoomPassage
- The Passage which connects us with another Room
- Passage - class Passage.
- Keep track of the connections among rooms.
- Passage() -
Constructor for class Passage
-
- passages -
Variable in class Room
- A list of all the passages heading out from here.
- play() -
Method in class GenerationGame
- Start the game
- play() -
Method in class MasterGame
- Start things going--note that this code can't be part of
the static method main because it needs to instantiate an
inner class.
- preClone() -
Method in class RealObject
- This is called before cloning an object, in case the object
wants to divide up its resources.
- preClone() -
Method in class Vines
- Cut back on excitement in cloned pieces.
- Predicate - class Predicate.
- The head of a hierarchy of classes that can evaluate conditions
on objects.
- Predicate() -
Constructor for class Predicate
-
- processFile(String, LineProcessor) -
Static method in class Utility
- Process a file, with callbacks for each line.
- processLine(String, int) -
Method in class RealObject.DescriptionLineProcessor
- Process a line from a long description file.
- processLine(String, int) -
Method in interface LineProcessor
- Called to process each line in the file.
R
- randomEntry() -
Method in class MyVector
- Selects an element at random from the vector
- RealObject - class RealObject.
- A Real Object is currently anything other than a passage.
- RealObject.ContentsMessager - class RealObject.ContentsMessager.
- A class that's used for sending identical messages to lots
of objects, usually all those in a Room.
- RealObject.ContentsMessager(RealObject, Object) -
Constructor for class RealObject.ContentsMessager
- The constructor lets you pass in any object which will
get remembered and be available to the message recipients.
- RealObject.DescriptionLineProcessor - class RealObject.DescriptionLineProcessor.
- This class is used in a callback context to process lines
in a long description file.
- RealObject.DescriptionLineProcessor(RealObject) -
Constructor for class RealObject.DescriptionLineProcessor
-
- RealObject() -
Constructor for class RealObject
-
- register(GameObject) -
Method in class RealObject
- Called when we become a parent.
- register(GameObject) -
Method in class MasterGame
- Learn that an object has come to be.
- removeTrailing(String, String) -
Static method in class Utility
- Remove trailing characters from a string.
- replace(String, String, String) -
Static method in class Utility
- Within a long string, replace a single occurence of one substring
with another.
- retval -
Variable in class RealObject.DescriptionLineProcessor
-
- Room - class Room.
- A Room is a GameObject that is usually connected to other Rooms
by Passages.
- Room.RoomPassage - class Room.RoomPassage.
- This inner class allows us to encapsulate information about a Passage
and its relationship with the current Room.
- Room.RoomPassage(Room, Passage, String) -
Constructor for class Room.RoomPassage
- The constructor should be called only from the Passage
constructor.
- Room() -
Constructor for class Room
-
- roomOf() -
Method in class RealObject
- Tell what room we're in
- run() -
Method in class SpyThread
- The thread's main method.
- runSpy() -
Method in class RealObject
- Give information to somebody who's spying on us.
- runSpy() -
Method in interface Spyable
- What's up?
S
- SaveListener - class SaveListener.
- Reusable listener that, when invoked, will save a Window's text area into a file.
- SaveListener(JTextArea, JFrame) -
Constructor for class SaveListener
- Initialize the listener
- select(String) -
Method in class MyVector
- Displays a window showing the elements of the vector in order,
allows the user to select one, and returns the result, or null.
- SelectWindow - class SelectWindow.
- A popup box to select an element from a vector
- SelectWindow(String, MyVector) -
Constructor for class SelectWindow
- Set up the window and display it.
- sendMessage(Object, String) -
Method in class GenerationGame
- Send a message to an object.
- sendMessage(Object, String) -
Method in class MasterGame
- Send a message to an object and report the results
- setClipboard(String) -
Static method in class Utility
- Put a string on the system clipboard
- setFrame(Frame) -
Static method in class Utility
- Set the default parent frame for popup windows.
- setMasterGame(MasterGame) -
Static method in class GameObject
- Set a class variable so we can find the master game object.
- setMessage(String) -
Method in class SpyWindow
- Set the message text in the window.
- setParent(RealObject) -
Method in class RealObject
- Set a new parent object.
- shortDescription -
Variable in class RealObject
- A short description of the object, suitable for use in
a list.
- spread() -
Method in class RealObject
- Try to spread to another room through a passage.
- spreadto -
Variable in class RealObject
- This is a list of rooms to which this object and its clones
have spread in order to avoid duplication.
- Spyable - interface Spyable.
- Identifies objects that can be sensibly spied upon.
- spyInfo -
Variable in class SpyThread
- An arbitrary object containing information
about what we're spying on.
- spySetup() -
Method in class GenerationGame
- Determine what object to spy on, probably by asking the user
- spySetup() -
Method in class MasterGame
- Find an object to spy on (or perhaps otherwise manipulate).
- SpyThread - class SpyThread.
- Spies on an object once per second and displays the results in
a SpyWindow.
- SpyThread(Object) -
Constructor for class SpyThread
- Note what it is that we're spying on.
- spyWindow -
Variable in class SpyThread
- The window in which our information is being displayed
- SpyWindow - class SpyWindow.
- Displays what's going on with one object
- SpyWindow(SpyThread, String) -
Constructor for class SpyWindow
- Drops widgets into the window and displays
- stringPiece(String, String, int) -
Static method in class Utility
- Extract a delimited substring from a string.
T
- tellAll(RealObject.ContentsMessager, boolean) -
Method in class RealObject
- This method is used to get this object and all the objects
contained in this one to run some code.
- Toddler - class Toddler.
- This class is intended to implement my own wonderful son,
Julian.
- Toddler() -
Constructor for class Toddler
- Sets mobility to .1
- toString() -
Method in class GameObject
- Convert the object to a string.
- toString() -
Method in class RealObject.DescriptionLineProcessor
- Called when we're all done to give us a chance to tell
what happened.
- toString() -
Method in class Room.RoomPassage
- Get a string representation of the object
- Trap - class Trap.
- A trap will grab any instances of a particular class and hold them hostage.
- Trap() -
Constructor for class Trap
-
- trappee -
Variable in class Trap
-
U
- unregister(GameObject) -
Method in class RealObject
- Called when we are no longer parent to an object.
- unregister(GameObject) -
Method in class MasterGame
- Learn that an object has ceased to be.
- Utility - class Utility.
- Class with assorted utility functions.
- Utility() -
Constructor for class Utility
-
V
- vegetarian -
Variable in class Animal
- Vegetarians eat only vegetarian food; non-vegetarians eat only meat.
- Vines - class Vines.
- Vines are Ensnarlers that spread.
- Vines() -
Constructor for class Vines
-
W
- Wanderer - class Wanderer.
- Objects which move from Room to Room of their own volition
- Wanderer() -
Constructor for class Wanderer
-
- wanderVia(Room.RoomPassage, String) -
Method in class RealObject
- Move from here to somewhere else, if we can, and make sure
that the whole world knows about it.
A B C D E F G H I K L M N O P R S T U V W