gizmoball.gameworld
Interface Trigger

All Known Implementing Classes:
AbsorbBallTrigger, ActivateGizmoTrigger, ActivateMissionTrigger, AnnihilateBothTrigger, BasicTrigger, BreakGizmoTrigger, CounterTrigger, GroupTrigger, MissionTrigger, NoCollisionTrigger, SetColorTrigger, SimpleCollisionTrigger, ToggleColorTrigger, ToggleTrigger

public interface Trigger

The base interface for all triggers.

Specification Fields :
priority : double // how important this trigger is

Method Summary
 java.util.List<Gizmo> getAssociatedGizmos()
          Gets all the gizmos that are associated with this trigger; ie all the gizmos that this trigger must keep an internal reference to.
 double priority()
          The priority of this trigger.
 void run(GameObject triggerObject, GameObject otherObject, GameObject triggerObjectCopy, GameObject otherObjectCopy)
          Runs this trigger.
 

Method Detail

priority

double priority()
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.

Returns:
this.priority

run

void run(GameObject triggerObject,
         GameObject otherObject,
         GameObject triggerObjectCopy,
         GameObject otherObjectCopy)
Runs this trigger. Reads from the first two arguments, writes to the second two arguments.

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:
modifies triggerObjectCopy and otherObjectCopy based on the fields read from triggerObject and otherObject

getAssociatedGizmos

java.util.List<Gizmo> getAssociatedGizmos()
Gets all the gizmos that are associated with this trigger; ie all the gizmos that this trigger must keep an internal reference to.

Returns:
the gizmos that this has an internal reference to