com.threerings.miso.client
Class TilePath
java.lang.Object
com.threerings.media.util.LineSegmentPath
com.threerings.miso.client.TilePath
- All Implemented Interfaces:
- Path, DirectionCodes
public class TilePath
- extends LineSegmentPath
The tile path represents a path of tiles through a scene. The path is
traversed by treating each pair of connected tiles as a line segment.
Only ambulatory sprites can follow a tile path, and their tile
coordinates are updated as the path is traversed.
|
Field Summary |
protected int |
_estimPixels
Estimated pixels traveled. |
protected Point |
_last
Used to compute estimated travel time. |
| Fields inherited from class com.threerings.media.util.LineSegmentPath |
_dest, _fracx, _fracy, _incx, _incy, _movex, _movey, _niter, _nodes, _nodestamp, _seglength, _src, _vel, DEFAULT_VELOCITY |
| Fields inherited from interface com.threerings.util.DirectionCodes |
CARDINAL_DIRECTIONS, CCW, CW, DIRECTION_COUNT, DOWN, EAST, EASTNORTHEAST, EASTSOUTHEAST, FINE_DIRECTION_COUNT, HORIZONTAL, LEFT, NONE, NORTH, NORTHEAST, NORTHNORTHEAST, NORTHNORTHWEST, NORTHWEST, RIGHT, SOUTH, SOUTHEAST, SOUTHSOUTHEAST, SOUTHSOUTHWEST, SOUTHWEST, UP, VERTICAL, WEST, WESTNORTHWEST, WESTSOUTHWEST |
|
Method Summary |
void |
addNode(int x,
int y,
int dir)
Add a node to the path with the specified destination point and facing direction. |
long |
getEstimTravelTime()
Returns the estimated number of millis that we'll be traveling
along this path. |
| Methods inherited from class com.threerings.media.util.LineSegmentPath |
createPath, fastForward, getFinalOrientation, getNextNode, getNode, headToNextNode, init, paint, setDuration, setVelocity, size, tick, toString, wasRemoved |
_last
protected Point _last
- Used to compute estimated travel time.
_estimPixels
protected int _estimPixels
- Estimated pixels traveled.
TilePath
public TilePath(MisoSceneMetrics metrics,
Sprite sprite,
List<Point> tiles,
int destx,
int desty)
- Constructs a tile path.
- Parameters:
metrics - the metrics for the scene the with which the path is
associated.sprite - the sprite to follow the path.tiles - the tiles to be traversed during the path.destx - the destination x-position in screen pixel
coordinates.desty - the destination y-position in screen pixel
coordinates.
getEstimTravelTime
public long getEstimTravelTime()
- Returns the estimated number of millis that we'll be traveling
along this path.
addNode
public void addNode(int x,
int y,
int dir)
- Description copied from class:
LineSegmentPath
- Add a node to the path with the specified destination point and facing direction.
- Overrides:
addNode in class LineSegmentPath
- Parameters:
x - the x-position.y - the y-position.dir - the facing direction.