rle.simple.board
Class LightMgr

java.lang.Object
  extended by rle.core.vm.PlugInBase
      extended by rle.simple.board.LightMgr
All Implemented Interfaces:
BoardListener, ThingListener, RuntimeDataListener, PlugIn

public class LightMgr
extends PlugInBase
implements ThingListener, BoardListener

This is a busy plug-in that maintains lighting conditions on the Board. When things move that have the runtime property light-radius set, we cast their light. When the GameContext enters a Board that has daylight, we give light to each thing. If the runtime property light-radius changes, we update the light. Finally, as things are added to or removed from the board we react appropriately.


Field Summary
 
Fields inherited from class rle.core.vm.PlugInBase
config, context, parameters
 
Constructor Summary
LightMgr()
           
 
Method Summary
protected  java.util.Set<RLPoint> computeFieldOfView(Thing t, int radius)
          Compute field-of-view.
 void dataChange(RuntimeDataEvent event)
           
 void initialize(Board b)
           
 void locationChange(ThingMoveEvent event)
           
 void thingInsert(ThingInsertEvent event)
           
 void thingRemove(ThingRemoveEvent event)
           
 
Methods inherited from class rle.core.vm.PlugInBase
config, getContext, getParameters, paramMap, setConfig, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LightMgr

public LightMgr()
Method Detail

initialize

public void initialize(Board b)

locationChange

public void locationChange(ThingMoveEvent event)
Specified by:
locationChange in interface ThingListener

dataChange

public void dataChange(RuntimeDataEvent event)
Specified by:
dataChange in interface RuntimeDataListener

thingInsert

public void thingInsert(ThingInsertEvent event)
Specified by:
thingInsert in interface BoardListener

computeFieldOfView

protected java.util.Set<RLPoint> computeFieldOfView(Thing t,
                                                    int radius)
Compute field-of-view.


thingRemove

public void thingRemove(ThingRemoveEvent event)
Specified by:
thingRemove in interface BoardListener