gizmoball.gameworld.gameobjects
Class PeriodicTriggerGizmo

java.lang.Object
  extended by gizmoball.gameworld.GameObject
      extended by gizmoball.gameworld.Gizmo
          extended by gizmoball.gameworld.gameobjects.PeriodicTriggerGizmo

public class PeriodicTriggerGizmo
extends Gizmo

A PeriodicTriggerGizmo triggers each of the triggers in its list every period

Specification Fields

Field Summary
 
Fields inherited from class gizmoball.gameworld.Gizmo
orientation, totalTranslation
 
Constructor Summary
PeriodicTriggerGizmo(double period)
          Creates a new PeriodicTriggerGizmo with a given period
 
Method Summary
 void addTrigger(Trigger t)
           
 void doActivate()
          A PeriodicTriggerGizmo does nothing when activated
protected  void doUpdate(double dt)
          The same as GameObject.update().
 GraphicsProperties getGraphicsProperties()
          A PeriodicTriggerGizmo cannot be displayed
 PhysicsModel getPhysicsModel()
          A PeriodicTriggerGizmo has no physics model
 java.lang.String getXMLString(java.lang.String name)
          returns the XML string that would be used to save this game object
 
Methods inherited from class gizmoball.gameworld.Gizmo
activate, copy, getBoundingBox, getCoeffReflectionString, getColorString, getCommonAttributesString, getDefaultTriggers, getOrientationDoubleString, getOrientationString, getReflectionCoeff, getTextureString, getTranslationString, getXMLDelay, getXMLDelayString, rotateAboutAxis, setCoefficientOfReflection, setCommonAttributes, setDelay, translateBy, update
 
Methods inherited from class gizmoball.gameworld.GameObject
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PeriodicTriggerGizmo

public PeriodicTriggerGizmo(double period)
Creates a new PeriodicTriggerGizmo with a given period

Parameters:
period -
Method Detail

addTrigger

public void addTrigger(Trigger t)
Effects:
adds t to this.triggers

doActivate

public void doActivate()
A PeriodicTriggerGizmo does nothing when activated

Specified by:
doActivate in class Gizmo

doUpdate

protected void doUpdate(double dt)
Description copied from class: Gizmo
The same as GameObject.update().

Specified by:
doUpdate in class Gizmo
Effects:
checks if the period has elapsed; if so, runs the triggers

getPhysicsModel

public PhysicsModel getPhysicsModel()
A PeriodicTriggerGizmo has no physics model

Specified by:
getPhysicsModel in class Gizmo
Returns:
null

getGraphicsProperties

public GraphicsProperties getGraphicsProperties()
A PeriodicTriggerGizmo cannot be displayed

Specified by:
getGraphicsProperties in class GameObject
Returns:
an empty invisible GraphicsProperties

getXMLString

public java.lang.String getXMLString(java.lang.String name)
Description copied from class: GameObject
returns the XML string that would be used to save this game object

Specified by:
getXMLString in class GameObject
Returns:
String s where s is sufficient to be directly inserted into an XML file where game world information is being saved