com.threerings.media.util
Class TimedPath

java.lang.Object
  extended by com.threerings.media.util.TimedPath
All Implemented Interfaces:
Path
Direct Known Subclasses:
ArcPath, DelayPath, LinePath

public abstract class TimedPath
extends Object
implements Path

A base class for path implementations that endeavor to move their pathables along a path in a specified number of milliseconds.


Field Summary
protected  long _duration
          The duration that we're to spend following the path.
protected  long _startStamp
          The time at which we started along the path.
 
Constructor Summary
TimedPath(long duration)
          Configures the timed path with the duration in which it must traverse its path.
 
Method Summary
 void fastForward(long timeDelta)
          This is called if the pathable is paused for some length of time and then unpaused.
 void init(Pathable pable, long timestamp)
          Called once to let the path prepare itself for the process of animating the supplied pathable.
 String toString()
           
protected  void toString(StringBuilder buf)
          An extensible method for generating a string representation of this instance.
 void wasRemoved(Pathable pable)
          When a path is removed from a pathable, whether that is because the path was completed or because it was replaced by another path, this method will be called to let the path know that it is no longer associated with this pathable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.threerings.media.util.Path
paint, tick
 

Field Detail

_duration

protected long _duration
The duration that we're to spend following the path.


_startStamp

protected long _startStamp
The time at which we started along the path.

Constructor Detail

TimedPath

public TimedPath(long duration)
Configures the timed path with the duration in which it must traverse its path.

Method Detail

init

public void init(Pathable pable,
                 long timestamp)
Description copied from interface: Path
Called once to let the path prepare itself for the process of animating the supplied pathable. Path users should also call Path.tick(com.threerings.media.util.Pathable, long) after Path.init(com.threerings.media.util.Pathable, long) with the same initialization timestamp.

Specified by:
init in interface Path

fastForward

public void fastForward(long timeDelta)
Description copied from interface: Path
This is called if the pathable is paused for some length of time and then unpaused. Paths should adjust any time stamps they are maintaining internally by the delta so that time maintains the illusion of flowing smoothly forward.

Specified by:
fastForward in interface Path

wasRemoved

public void wasRemoved(Pathable pable)
Description copied from interface: Path
When a path is removed from a pathable, whether that is because the path was completed or because it was replaced by another path, this method will be called to let the path know that it is no longer associated with this pathable.

Specified by:
wasRemoved in interface Path

toString

public String toString()
Overrides:
toString in class Object

toString

protected void toString(StringBuilder buf)
An extensible method for generating a string representation of this instance.