|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Object
|
+--GameObject
|
+--RealObject
|
+--Wanderer
|
+--Animal
|
+--Mouse
The Mouse can escape from the trap and also is Food for the Cat.
Cat| Inner classes inherited from class RealObject |
RealObject.ContentsMessager, RealObject.DescriptionLineProcessor |
| Inner classes inherited from class GameObject |
GameObject.LeaveInfo |
| Fields inherited from class Animal |
eaten, hunger, vegetarian |
| Fields inherited from class Wanderer |
mobility |
| Fields inherited from class RealObject |
contents, longDescription, parentObject, shortDescription, spreadto |
| Fields inherited from class GameObject |
masterGame, name |
| Constructor Summary | |
(package private) |
Mouse()
Set instance variables |
| Method Summary | |
void |
doAction()
If we're in a trap (or other object), escape with 1/3 probability; otherwise do what the super says to. |
void |
eatMe()
If we get eaten, squeal and go away. |
double |
getCalories()
How many calories are we? |
boolean |
isVegetarian()
I don't think vegetarians can eat mice. |
| Methods inherited from class Wanderer |
initialize |
| Methods inherited from class RealObject |
checkLeave, clone, getLongDescription, getParent, getShortDescription, getSpreadability, goodbye, hello, isPredicate, preClone, register, roomOf, runSpy, setParent, spread, tellAll, unregister, wanderVia |
| Methods inherited from class GameObject |
announce, compareTo, getMasterGame, kill, listen, newInstance, setMasterGame, toString |
| Methods inherited from class java.lang.Object |
|
| Constructor Detail |
Mouse()
| Method Detail |
public void doAction()
doAction in class AnimalAnimalFoodpublic void eatMe()
eatMe in interface Foodpublic double getCalories()
getCalories in interface Foodpublic boolean isVegetarian()
isVegetarian in interface Food
|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||