com.threerings.media.util
Class DelayPath

java.lang.Object
  extended by com.threerings.media.util.TimedPath
      extended by com.threerings.media.util.DelayPath
All Implemented Interfaces:
Path

public class DelayPath
extends TimedPath

A convenience path that waits a specified amount of time.


Field Summary
protected  Point _source
          Source point.
 
Fields inherited from class com.threerings.media.util.TimedPath
_duration, _startStamp
 
Constructor Summary
DelayPath(int x, int y, long duration)
          Move to the sprite to the supplied location then wait for the duration.
DelayPath(long duration)
          Cause the current path to remain unchanged for the duration.
DelayPath(Point source, long duration)
          Move to the sprite to the supplied location then wait for the duration.
 
Method Summary
 void init(Pathable pable, long timestamp)
          Called once to let the path prepare itself for the process of animating the supplied pathable.
 void paint(Graphics2D gfx)
          Paint this path on the screen (used for debugging purposes only).
 boolean tick(Pathable pable, long tickstamp)
          Called to request that this path update the position of the specified pathable based on the supplied timestamp information.
 
Methods inherited from class com.threerings.media.util.TimedPath
fastForward, toString, toString, wasRemoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_source

protected Point _source
Source point.

Constructor Detail

DelayPath

public DelayPath(long duration)
Cause the current path to remain unchanged for the duration.


DelayPath

public DelayPath(int x,
                 int y,
                 long duration)
Move to the sprite to the supplied location then wait for the duration.


DelayPath

public DelayPath(Point source,
                 long duration)
Move to the sprite to the supplied location then wait for the duration.

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
Overrides:
init in class TimedPath

paint

public void paint(Graphics2D gfx)
Description copied from interface: Path
Paint this path on the screen (used for debugging purposes only).


tick

public boolean tick(Pathable pable,
                    long tickstamp)
Description copied from interface: Path
Called to request that this path update the position of the specified pathable based on the supplied timestamp information. A path should record its initial timestamp and determine the progress of the pathable along the path based on the time elapsed since the pathable began down the path.

Parameters:
pable - the pathable whose position should be updated.
tickstamp - the timestamp associated with this frame.
Returns:
true if the pathable's position was updated, false if the path determined that the pathable should not move at this time.