gizmoball.gameworld.triggers
Class AbsorbBallTrigger

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

public class AbsorbBallTrigger
extends java.lang.Object
implements Trigger

A trigger that makes the ball get absorbed by the specified BallShooter (which does not necessarily have to be one of the objects in the collision).

Specification Fields :
ballShooter : BallShooter // the BallShooter that absorbs the ball

Constructor Summary
AbsorbBallTrigger(BallShooter a)
          Creates the trigger, given the ballshooter that will be absorbing the ball.
 
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()
          This is higher than the ball collide trigger
 void run(GameObject triggerObject, GameObject otherObject, GameObject triggerObjectCopy, GameObject otherObjectCopy)
          Adds the ball to the ballShooter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbsorbBallTrigger

public AbsorbBallTrigger(BallShooter a)
Creates the trigger, given the ballshooter that will be absorbing the ball.

Method Detail

priority

public double priority()
This is higher than the ball collide trigger

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

run

public void run(GameObject triggerObject,
                GameObject otherObject,
                GameObject triggerObjectCopy,
                GameObject otherObjectCopy)
Adds the ball to the ballShooter

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

getAssociatedGizmos

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

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