|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.properties.PList wyvern.kernel.maps.MapObject wyvern.lib.classes.construct.Switch wyvern.lib.classes.construct.Lever
This class implements something you can pull, flip or toggle to activate some other object.
Field Summary |
Fields inherited from class wyvern.kernel.maps.MapObject |
IN_MAP_EDITOR, listenerList_ |
Fields inherited from class wyvern.kernel.properties.PList |
readOnly_ |
Fields inherited from interface wyvern.lib.PropertyList |
PROPERTY_PACKAGE |
Constructor Summary | |
Lever()
|
Method Summary | |
void |
apply(Commandable agent)
Called by the ApplyCommand when the agent performs "apply". |
CommandEvent |
createEvent(CommandEvent event)
Creates an event to encapsulate the pull or push. |
boolean |
execute(CommandEvent event)
Executes the "pull" (or "push") event. |
void |
initialize()
Initializes the object's default properties. |
boolean |
knowsCommand(java.lang.String cmd)
Returns true if we want to handle the command. |
Methods inherited from class wyvern.lib.classes.construct.Switch |
getTargets, toggleAllGates, toggleGate, toggleImage |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Lever()
Method Detail |
public void initialize()
GameObject
initialize
in interface GameObject
initialize
in class MapObject
public boolean knowsCommand(java.lang.String cmd)
knowsCommand
in interface Command
cmd
- the command to check
public CommandEvent createEvent(CommandEvent event)
createEvent
in interface Command
event
- a bare event containing the agent & command text
A HookCallback that needs to know the gates being opened can deduce them from this information. It's possible to modify the points in the PointList (and/or the objects they refer to) in a hook callback, to modify the operation of the lever. The lever will look at the PointList in its execute() method and will figure out what gates to open from there.
public boolean execute(CommandEvent event)
execute
in interface Command
event
- the CommandEvent
public void apply(Commandable agent)
apply
in interface Applyable
agent
- the agent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |