unc.cdva.interactiveitems
Class Target

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

public class Target
extends MobileItem

Stores state of a target as well as static data, such as target min/max speed, and min/max scaling. (note a target is something like a boat, do not confuse it with a reticle)

Author:
Dan Van Atta, Guillaume Conte

Field Summary
 
Fields inherited from class unc.cdva.interactiveitems.MobileItem
MOVING, STOPPED
 
Fields inherited from class unc.cdva.interactiveitems.InteractiveItem
direction, position, scaling
 
Constructor Summary
Target()
          Initializes a target to some offscreen location, the initial state is stopped, set it to moving to have the target start moving on screen.
 
Method Summary
 void advanceInTime(long delta)
          Advances the target in time, effectively it updates the position of the boat, when the screen is redrawn it will move.
 void explode()
          Sets the state of the target to 'exploding.'
static javax.vecmath.Vector3f getMaxScaling()
           
static float getMaxSpeed()
           
static javax.vecmath.Vector3f getMinScaling()
           
static float getMinSpeed()
           
 boolean isExploding()
           
 boolean isSunk()
           
static void setMaxScaling(javax.vecmath.Vector3f maxScaling)
           
static void setMaxSpeed(float maxSpeed)
           
static void setMinScaling(javax.vecmath.Vector3f minScaling)
           
static void setMinSpeed(float minSpeed)
           
 void sink()
          Sets the state of the target to 'sinking.'
 
Methods inherited from class unc.cdva.interactiveitems.MobileItem
isMoving, isStopped, setMoving, setStopped
 
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

Target

public Target()
Initializes a target to some offscreen location, the initial state is stopped, set it to moving to have the target start moving on screen.

Method Detail

advanceInTime

public void advanceInTime(long delta)
Advances the target in time, effectively it updates the position of the boat, when the screen is redrawn it will move.

Specified by:
advanceInTime in class MobileItem
Parameters:
delta - the amount of time to elapse

sink

public void sink()
Sets the state of the target to 'sinking.'


explode

public void explode()
Sets the state of the target to 'exploding.'


isSunk

public boolean isSunk()
Returns:
True if the target is in the 'sining' state, false otherwise.

isExploding

public boolean isExploding()
Returns:
True if the target is in the 'exploding' state, false otherwise.

getMaxScaling

public static javax.vecmath.Vector3f getMaxScaling()
Returns:
Returns the maxScaling.

getMaxSpeed

public static float getMaxSpeed()
Returns:
Returns the maxSpeed.

getMinScaling

public static javax.vecmath.Vector3f getMinScaling()
Returns:
Returns the minScaling.

getMinSpeed

public static float getMinSpeed()
Returns:
Returns the minSpeed.

setMaxScaling

public static void setMaxScaling(javax.vecmath.Vector3f maxScaling)
Parameters:
maxScaling - The maxScaling to set.

setMaxSpeed

public static void setMaxSpeed(float maxSpeed)
Parameters:
maxSpeed - The maxSpeed to set.

setMinScaling

public static void setMinScaling(javax.vecmath.Vector3f minScaling)
Parameters:
minScaling - The minScaling to set.

setMinSpeed

public static void setMinSpeed(float minSpeed)
Parameters:
minSpeed - The minSpeed to set.