|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Object
|
+--GameObject
|
+--RealObject
|
+--Wanderer
|
+--Animal
Animals wander and also eat.
| Inner classes inherited from class RealObject |
RealObject.ContentsMessager, RealObject.DescriptionLineProcessor |
| Inner classes inherited from class GameObject |
GameObject.LeaveInfo |
| Field Summary | |
(package private) boolean |
eaten
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. |
protected double |
hunger
How hungry are we? 0.0 means not at all; 100.0 means we'll try every turn. |
protected boolean |
vegetarian
Vegetarians eat only vegetarian food; non-vegetarians eat only meat. |
| 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) |
Animal()
|
| Method Summary | |
void |
doAction()
If we're hungry enough, search the room for a food item and eat it if it matches our diet. |
| 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 |
|
| Field Detail |
boolean eaten
protected double hunger
protected boolean vegetarian
| Constructor Detail |
Animal()
| Method Detail |
public void doAction()
doAction in class WandererFood
|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||