Class Wanderer

java.lang.Object
  |
  +--GameObject
        |
        +--RealObject
              |
              +--Wanderer
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, Spyable
Direct Known Subclasses:
Animal, Dog, Toddler

class Wanderer
extends RealObject

Objects which move from Room to Room of their own volition


Inner classes inherited from class RealObject
RealObject.ContentsMessager, RealObject.DescriptionLineProcessor
 
Inner classes inherited from class GameObject
GameObject.LeaveInfo
 
Field Summary
protected  double mobility
          Mobility ranges from 0.0 (stuck in the mud) to 1.0 (move every turn)
 
Fields inherited from class RealObject
contents, longDescription, parentObject, shortDescription, spreadto
 
Fields inherited from class GameObject
masterGame, name
 
Constructor Summary
(package private) Wanderer()
           
 
Method Summary
 void doAction()
          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.
 void initialize(java.lang.String initializer, GameObject parentObjectArg)
          Initialize a Wanderer with the usual arguments, plus mobility
 
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
 

Field Detail

mobility

protected double mobility
Mobility ranges from 0.0 (stuck in the mud) to 1.0 (move every turn)
Constructor Detail

Wanderer

Wanderer()
Method Detail

doAction

public void doAction()
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.
Overrides:
doAction in class RealObject

initialize

public void initialize(java.lang.String initializer,
                       GameObject parentObjectArg)
                throws GameException
Initialize a Wanderer with the usual arguments, plus mobility
Overrides:
initialize in class RealObject
Parameters:
initializer - adds a fourth tilde piece with a number indicating how mobile the object is.