org.starhope.appius.game.npc
Class Projectile.ProjectileWatcher
java.lang.Object
org.starhope.appius.game.npc.Projectile.ProjectileWatcher
- All Implemented Interfaces:
- AcceptsMetronomeTicks, HasName
- Enclosing class:
- Projectile
private static final class Projectile.ProjectileWatcher
- extends Object
- implements AcceptsMetronomeTicks
- Author:
- brpocock@star-hope.org
Method Summary |
String |
getName()
Return a user-visible, unique name for this class. |
void |
tick(long currentTime,
long deltaTime)
This method is called periodically from the metronome thread. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
myProjectile
private final Projectile myProjectile
- the projectile I'm watching
polygon
private final PolygonPrimitive<?> polygon
- The polygon outline of the projectile (scaled)
Projectile.ProjectileWatcher
public Projectile.ProjectileWatcher(Projectile projectile)
- Parameters:
projectile
- to be watched
getName
public String getName()
- Description copied from interface:
HasName
- Return a user-visible, unique name for this class. This name may
not necessarily be globally unique, but must be unique across all
objects of this class. For example, having both a User and a Zone
named “Lightning” is acceptable, but there may not be two users
with the same name.
- Specified by:
getName
in interface HasName
- Returns:
- a user-visible string name for this instance
- See Also:
HasName.getName()
tick
public void tick(long currentTime,
long deltaTime)
throws UserDeadException
- Description copied from interface:
AcceptsMetronomeTicks
- This method is called periodically from the metronome thread. To
save computation, it receives both the current time since epoch
in milliseconds at the start of the global tick propagation, and
the delta time since the previous metronome tick.
- Specified by:
tick
in interface AcceptsMetronomeTicks
- Parameters:
currentTime
- Time since epoch at the start of the global
metronome propagation, as per
System.currentTimeMillis()deltaTime
- Delta-time in milliseconds since the prior
global metronome tick
- Throws:
UserDeadException
- if a user has died during this tick- See Also:
AcceptsMetronomeTicks.tick(long,
long)