Class Ensnarler

java.lang.Object
  |
  +--GameObject
        |
        +--RealObject
              |
              +--Ensnarler
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, Spyable
Direct Known Subclasses:
Vines

class Ensnarler
extends RealObject

Objects that grab other objects as they're trying to leave the room.


Inner classes inherited from class RealObject
RealObject.ContentsMessager, RealObject.DescriptionLineProcessor
 
Inner classes inherited from class GameObject
GameObject.LeaveInfo
 
Field Summary
protected  java.lang.String ensnarlMessage
          Try to grab things when they leave.
protected  double ensnarlRate
          What is the chance that we will go for it? Ranges from 0 to 1.
 
Fields inherited from class RealObject
contents, longDescription, parentObject, shortDescription, spreadto
 
Fields inherited from class GameObject
masterGame, name
 
Constructor Summary
(package private) Ensnarler()
           
 
Method Summary
 void initialize(java.lang.String initializer, GameObject parentObjectArg)
          The usual initialization
 
Methods inherited from class RealObject
checkLeave, clone, doAction, 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

ensnarlMessage

protected java.lang.String ensnarlMessage
Try to grab things when they leave. We do this with a probability that depends on our ensnarlRate and hold back when the leaver is a relative (i.e., its Class is the same as ours).

ensnarlRate

protected double ensnarlRate
What is the chance that we will go for it? Ranges from 0 to 1.
Constructor Detail

Ensnarler

Ensnarler()
Method Detail

initialize

public void initialize(java.lang.String initializer,
                       GameObject parentObjectArg)
                throws GameException
The usual initialization
Overrides:
initialize in class RealObject
Parameters:
initializer - The fourth tilde piece is the message to be displayed when we ensnarl something.