unc.cdva.interactiveitems
Class RangeCar
java.lang.Object
unc.cdva.utils.TaggedObject
unc.cdva.interactiveitems.InteractiveItem
unc.cdva.interactiveitems.AnimatedItem
unc.cdva.interactiveitems.MobileItem
unc.cdva.interactiveitems.RangeCar
- All Implemented Interfaces:
- Taggable
public class RangeCar
- extends MobileItem
RangeCar object, keeps track of the rangecars state.
There is a one to one mapping between players, guns, and
rangecars. Given the one to one mapping, a rangeCar
simply has the same Id as the player who owns the
rangeCar.
Rangecar has a simple implementation thus far, and is
either moving or stationary.
TODO Have the range car actually turn around, rather than flipping directions.
- Author:
- Dan Van Atta, Guillaume Conte
Constructor Summary |
RangeCar(Id playerId,
Gun gun)
Constructor for a rangecar. |
Method Summary |
void |
advanceInTime(long delta)
Moves the range car, which moves at a certain speed, thus
for the amount of time that has elapsed, the rangecar will
move the right amount in the direction it is 'facing'. |
javax.vecmath.Vector3f |
getDestination()
|
void |
setDestination(javax.vecmath.Vector3f destination)
Sets the destination of the range car. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
RangeCar
public RangeCar(Id playerId,
Gun gun)
- Constructor for a rangecar. All that is required is
the id of the player associated with the rangecar.
- Parameters:
playerId
- The id of the player the range car is
associated with.gun
- Used to place the initial position of the
rangecar.
advanceInTime
public void advanceInTime(long delta)
- Moves the range car, which moves at a certain speed, thus
for the amount of time that has elapsed, the rangecar will
move the right amount in the direction it is 'facing'.
- Specified by:
advanceInTime
in class MobileItem
- Parameters:
delta
- The amount of time in ms to elapse.
setDestination
public void setDestination(javax.vecmath.Vector3f destination)
- Sets the destination of the range car. It will move towards
this destination.
- Parameters:
destination
- Where the range car should move to.
getDestination
public javax.vecmath.Vector3f getDestination()
- Returns:
- The destination of the range car, where it is travelling to.