Class Mouse

java.lang.Object
  |
  +--GameObject
        |
        +--RealObject
              |
              +--Wanderer
                    |
                    +--Animal
                          |
                          +--Mouse
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, Food, Spyable

class Mouse
extends Animal
implements Food

The Mouse can escape from the trap and also is Food for the Cat.

See Also:
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
, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Mouse

Mouse()
Set instance variables
Method Detail

doAction

public void doAction()
If we're in a trap (or other object), escape with 1/3 probability; otherwise do what the super says to.
Overrides:
doAction in class Animal
Following copied from class: Animal
See Also:
Food

eatMe

public void eatMe()
If we get eaten, squeal and go away.
Specified by:
eatMe in interface Food

getCalories

public double getCalories()
How many calories are we?
Specified by:
getCalories in interface Food
Returns:
Always returns 300. (I guessed; it wasn't in Weight Watchers.)

isVegetarian

public boolean isVegetarian()
I don't think vegetarians can eat mice.
Specified by:
isVegetarian in interface Food
Returns:
Always false, of course.