|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Object
|
+--GenerationGame
|
+--MasterGame
This is the class that runs everything
| Field Summary | |
(package private) java.lang.String |
generationInfo
A string used by announce to collect information on what's happening. |
(package private) java.util.GregorianCalendar |
masterTime
The game time, unrelated to the real clock time |
(package private) MyVector |
objects
A list of all the objects in the game |
| Fields inherited from class GenerationGame |
gameFile |
| Constructor Summary | |
(package private) |
MasterGame(java.lang.String[] args)
Create the game and do some initial bookkeeping |
| Method Summary | |
void |
announce(GameObject thing,
java.lang.String msg)
Add an object's message to the current game state. |
void |
announce(java.lang.String msg)
Add a message to the current game state for later display. |
GameObject |
findObjectByName(java.lang.String name)
Given the name of an object, find it. |
(package private) java.lang.String |
getNextName(java.lang.String name)
Generate an unused name with a given alphabetic beginning |
java.util.GregorianCalendar |
getTime()
What time do we have? |
static void |
main(java.lang.String[] args)
Create a game and play it |
java.lang.String |
next()
Move to the next generation by incrementing the time and letting all of our objects do something. |
(package private) void |
play()
Start things going--note that this code can't be part of the static method main because it needs to instantiate an inner class. |
void |
register(GameObject thing)
Learn that an object has come to be. |
java.lang.String |
sendMessage(java.lang.Object recipient,
java.lang.String message)
Send a message to an object and report the results |
java.lang.Object |
spySetup()
Find an object to spy on (or perhaps otherwise manipulate). |
void |
unregister(GameObject thing)
Learn that an object has ceased to be. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
java.lang.String generationInfo
announce to collect information on what's happening. It
gets reset at the beginning of each event and is returned to
the caller at the end.java.util.GregorianCalendar masterTime
final MyVector objects
| Constructor Detail |
MasterGame(java.lang.String[] args)
args - as in main| Method Detail |
public void announce(GameObject thing,
java.lang.String msg)
thing - who said itwhat - they saidpublic void announce(java.lang.String msg)
msg - The message to be added
public GameObject findObjectByName(java.lang.String name)
throws CantFindObjectException
name - the name to findCantFindObjectException - if no object is foundjava.lang.String getNextName(java.lang.String name)
name - how the name should start, perhaps with some
numbers at the end which will be discardedpublic java.util.GregorianCalendar getTime()
public static void main(java.lang.String[] args)
args - the usualpublic java.lang.String next()
next in class GenerationGameGameObject.doAction()void play()
play in class GenerationGamepublic void register(GameObject thing)
thing - a new object that we need to remember.
public java.lang.String sendMessage(java.lang.Object recipient,
java.lang.String message)
sendMessage in class GenerationGamerecipient - a Game Object to get the messagepublic java.lang.Object spySetup()
spySetup in class GenerationGamepublic void unregister(GameObject thing)
thing - an old object that we need to forget.
|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||