gizmoball.gameworld.triggers
Class BasicTrigger

java.lang.Object
  extended by gizmoball.gameworld.triggers.BasicTrigger
All Implemented Interfaces:
Trigger
Direct Known Subclasses:
AnnihilateBothTrigger

public abstract class BasicTrigger
extends java.lang.Object
implements Trigger

A class that implements basic versions of priority() and getAssociatedGizmos(), to make it easier to subclass.


Constructor Summary
BasicTrigger()
           
 
Method Summary
 java.util.List<Gizmo> getAssociatedGizmos()
          Returns an empty list.
 double priority()
          Returns the priority 0.
abstract  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

BasicTrigger

public BasicTrigger()
Method Detail

getAssociatedGizmos

public java.util.List<Gizmo> getAssociatedGizmos()
Returns an empty list.

Specified by:
getAssociatedGizmos in interface Trigger
Returns:
the gizmos that this has an internal reference to

priority

public double priority()
Returns the priority 0.

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

run

public abstract 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