gizmoball.gameworld.triggers
Class ToggleTrigger

java.lang.Object
  extended by gizmoball.gameworld.triggers.ToggleTrigger
All Implemented Interfaces:
Trigger

public class ToggleTrigger
extends java.lang.Object
implements Trigger

This Trigger toggles the given ToggleGizmo.

Specification Fields :
gizmo : ToggleGizmo // the ToggleGizmo changed

Constructor Summary
ToggleTrigger(ToggleGizmo gizmo)
           
 
Method Summary
 java.util.List<Gizmo> getAssociatedGizmos()
          This ToggleTrigger acts only on this.gizmo
 double priority()
          The priority of this trigger.
 void run(GameObject triggerObject, GameObject otherObject, GameObject triggerObjectCopy, GameObject otherObjectCopy)
          Runs this trigger.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToggleTrigger

public ToggleTrigger(ToggleGizmo gizmo)
Parameters:
gizmo -
Effects:
creates a new ToggleTrigger for gizmo
Method Detail

getAssociatedGizmos

public java.util.List<Gizmo> getAssociatedGizmos()
This ToggleTrigger acts only on this.gizmo

Specified by:
getAssociatedGizmos in interface Trigger
Returns:
a list with this.gizmo

priority

public double priority()
Description copied from interface: Trigger
The priority of this trigger. Higher priority means that the effects of this trigger are more important, and will overwrite effects of lower-priority triggers.

Specified by:
priority in interface Trigger
Returns:
this.priority

run

public void run(GameObject triggerObject,
                GameObject otherObject,
                GameObject triggerObjectCopy,
                GameObject otherObjectCopy)
Description copied from interface: Trigger
Runs this trigger. Reads from the first two arguments, writes to the second two arguments.

Specified by:
run in interface Trigger
Parameters:
triggerObject - the GameObject that is linked to this trigger
otherObject - the other GameObject that was involved in this event
triggerObjectCopy - a copy that should be modified
otherObjectCopy - a copy that should be modified
Effects:
toggles this.gizmo