public class LocalPath extends Path
Constructor and Description |
---|
LocalPath(Locatable end,
APIContext ctx)
Construct a new path.
|
LocalPath(Locatable end,
double precision,
APIContext ctx)
Construct a new path.
|
LocalPath(Locatable start,
Locatable end,
APIContext ctx)
Construct a new path.
|
LocalPath(Locatable start,
Locatable end,
double precision,
APIContext ctx)
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() |
void |
setStart(Tile start) |
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.
|
enableRun, getPrecision
public LocalPath(Locatable end, APIContext ctx)
end
- the destinationctx
- APIContext
public LocalPath(Locatable end, double precision, APIContext ctx)
end
- the destinationprecision
- how far off the destination this path is considered completedctx
- APIContext
public LocalPath(Locatable start, Locatable end, APIContext ctx)
start
- the originend
- the destinationctx
- APIContext
public LocalPath(Locatable start, Locatable end, double precision, APIContext ctx)
start
- the originend
- the destinationprecision
- how far off the destination this path is considered completedctx
- APIContext
public 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 void setStart(Tile start)
public Tile getStart()
Path