unc.cdva.interactiveitems
Class Reticle

java.lang.Object
  extended by unc.cdva.utils.TaggedObject
      extended by unc.cdva.interactiveitems.InteractiveItem
          extended by unc.cdva.interactiveitems.Reticle
All Implemented Interfaces:
Taggable

public class Reticle
extends InteractiveItem

Reticle object, merely stores the state of the object. The id of a reticle should be set to that of a problem! Reticle objects turn out to be a placeholder and glue between the time a user clicks, enter their answer, and fires. Every reticle is associated with exactly one problem.

Author:
Guillaume Conte

Field Summary
 
Fields inherited from class unc.cdva.interactiveitems.InteractiveItem
direction, position, scaling
 
Constructor Summary
Reticle()
          Initializes a reticle object, the position of the reticle needs to be set, as it is is initialized to a default value.
 
Method Summary
 void advanceInTime(long delta)
          Advances the reticle in time, essentially the reticles are all frozen after a shot, advancing the reticle in time will get it closer to being unfrozen.
 boolean isWaitingForFire()
           
 boolean isWaitingForGun()
           
 boolean isWaitingForValue()
           
 void revertState()
          Used to revert the state of the reticle (typically used when the gun is finished reloading)
 void waitForFire()
          Puts the reticle in teh 'wait for fire' state.
 void waitForGun(long reloadTime)
          'P
 void waitForValue()
          Puts the reticle into the 'wait for value' state.
 
Methods inherited from class unc.cdva.interactiveitems.InteractiveItem
getDirection, getPdsBean, getPosition, getScaling, getState, setDirection, setPds, setPosition, setScaling, setState
 
Methods inherited from class unc.cdva.utils.TaggedObject
createId, equals, getId, hashCode, setId, setId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Reticle

public Reticle()
Initializes a reticle object, the position of the reticle needs to be set, as it is is initialized to a default value.

Method Detail

advanceInTime

public void advanceInTime(long delta)
Advances the reticle in time, essentially the reticles are all frozen after a shot, advancing the reticle in time will get it closer to being unfrozen.


revertState

public void revertState()
Used to revert the state of the reticle (typically used when the gun is finished reloading)


waitForValue

public void waitForValue()
Puts the reticle into the 'wait for value' state.


waitForFire

public void waitForFire()
Puts the reticle in teh 'wait for fire' state.


waitForGun

public void waitForGun(long reloadTime)
'P

Parameters:
reloadTime -

isWaitingForValue

public boolean isWaitingForValue()
Returns:
True if the gun is in the 'wait for gun' state, false otherwise.

isWaitingForFire

public boolean isWaitingForFire()
Returns:
True if the gun is in the 'wait for fire' state (ie: the gun is ready to be fired), false otherwise.

isWaitingForGun

public boolean isWaitingForGun()
Returns:
True if the gun is in the 'wait for gun' state, false otherwise.