public class TilePath extends Path
Constructor and Description |
---|
TilePath(double precision,
Tile... tiles)
Construct a new path.
|
TilePath(Tile... tiles)
Construct a new path.
|
Modifier and Type | Method and Description |
---|---|
Tile |
getEnd()
Gets the end tile of this path.
|
Tile |
getNext(APIContext ctx)
Gets the next available tile in this path.
|
Tile |
getStart()
Gets the start tile of this path.
|
Tile[] |
getTiles() |
TilePath |
randomize(int maxX,
int maxY) |
TilePath |
reversed() |
boolean |
traverse(APIContext ctx)
Takes a step along this path if appropriate.
|
boolean |
traverse(APIContext ctx,
boolean run)
Takes a step along this path if appropriate.
|
boolean |
validate(APIContext ctx)
Checks whether or not this path can be traversed by the player.
|
protected boolean |
walk(APIContext ctx,
Tile next) |
enableRun, getPrecision
protected Tile[] tiles
public TilePath(Tile... tiles)
tiles
- the tiles to walk onpublic TilePath(double precision, Tile... tiles)
precision
- how far off the destination this path is considered completedtiles
- the tiles to walk onpublic boolean traverse(APIContext ctx)
Path
traverse
in class Path
ctx
- APIContext
public boolean traverse(APIContext ctx, boolean run)
Path
traverse
in class Path
ctx
- APIContext
run
- true to enable runpublic boolean validate(APIContext ctx)
Path
validate
in class Path
ctx
- APIContext
public Tile getNext(APIContext ctx)
Path
getNext
in class Path
ctx
- APIContext
public Tile getStart()
Path
protected boolean walk(APIContext ctx, Tile next)
public TilePath randomize(int maxX, int maxY)
public TilePath reversed()