Class Vines

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

class Vines
extends Ensnarler

Vines are Ensnarlers that spread. Perhaps this class should also implement Food, along the lines of FoodHunk.


Inner classes inherited from class RealObject
RealObject.ContentsMessager, RealObject.DescriptionLineProcessor
 
Inner classes inherited from class GameObject
GameObject.LeaveInfo
 
Field Summary
protected  double growth
          How likely we are to spread on a given turn.
 
Fields inherited from class Ensnarler
ensnarlMessage, ensnarlRate
 
Fields inherited from class RealObject
contents, longDescription, parentObject, shortDescription, spreadto
 
Fields inherited from class GameObject
masterGame, name
 
Constructor Summary
(package private) Vines()
           
 
Method Summary
 void doAction()
          Take the default action, then make us a bit more likely to spread or ensnarl.
 double getSpreadability()
          Tell how likely we are to spread this turn.
protected  void preClone()
          Cut back on excitement in cloned pieces.
 
Methods inherited from class Ensnarler
initialize
 
Methods inherited from class RealObject
checkLeave, clone, getLongDescription, getParent, getShortDescription, goodbye, hello, isPredicate, 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

growth

protected double growth
How likely we are to spread on a given turn. This begins at zero and increases by 1% each turn, or more accurately, the chance that we won't spread begins at 100% and is multiplied by .99 each turn.
Constructor Detail

Vines

Vines()
Method Detail

doAction

public void doAction()
Take the default action, then make us a bit more likely to spread or ensnarl.
Overrides:
doAction in class RealObject

getSpreadability

public double getSpreadability()
Tell how likely we are to spread this turn.
Overrides:
getSpreadability in class RealObject
Returns:
the extent of our growth.

preClone

protected void preClone()
Cut back on excitement in cloned pieces. The idea here is that if something grows into another room, both the new piece and the original are smaller and weaker than before. But they'll grow back if you give them time.
Overrides:
preClone in class RealObject