Class LocalPath
- java.lang.Object
-
- com.epicbot.api.shared.model.path.Path
-
- com.epicbot.api.shared.model.path.LocalPath
-
public class LocalPath extends Path
A path calculated using the current available collision region/scene data.
-
-
Constructor Summary
Constructors Constructor Description LocalPath(Locatable end, double precision, APIContext ctx)
Construct a new path.LocalPath(Locatable end, APIContext ctx)
Construct a new path.LocalPath(Locatable start, Locatable end, double precision, APIContext ctx)
Construct a new path.LocalPath(Locatable start, Locatable end, APIContext ctx)
Construct a new path.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.-
Methods inherited from class com.epicbot.api.shared.model.path.Path
enableRun, getPrecision
-
-
-
-
Constructor Detail
-
LocalPath
public LocalPath(Locatable end, APIContext ctx)
Construct a new path.- Parameters:
end
- the destinationctx
-APIContext
-
LocalPath
public LocalPath(Locatable end, double precision, APIContext ctx)
Construct a new path.- Parameters:
end
- the destinationprecision
- how far off the destination this path is considered completedctx
-APIContext
-
LocalPath
public LocalPath(Locatable start, Locatable end, APIContext ctx)
Construct a new path.- Parameters:
start
- the originend
- the destinationctx
-APIContext
-
LocalPath
public LocalPath(Locatable start, Locatable end, double precision, APIContext ctx)
Construct a new path.- Parameters:
start
- the originend
- the destinationprecision
- how far off the destination this path is considered completedctx
-APIContext
-
-
Method Detail
-
traverse
public boolean traverse(APIContext ctx)
Description copied from class:Path
Takes a step along this path if appropriate.- Specified by:
traverse
in classPath
- Parameters:
ctx
-APIContext
- Returns:
- true if we are traversing this path, otherwise false. False can mean the destination is already reached or path destination is unreachable.
-
traverse
public boolean traverse(APIContext ctx, boolean run)
Description copied from class:Path
Takes a step along this path if appropriate.- Specified by:
traverse
in classPath
- Parameters:
ctx
-APIContext
run
- true to enable run- Returns:
- true if we are traversing this path, otherwise false. False can mean the destination is already reached or path destination is unreachable.
-
validate
public boolean validate(APIContext ctx)
Description copied from class:Path
Checks whether or not this path can be traversed by the player. This will be the case when the player is near to one of its vertices, but not already standing on the end vertex.- Specified by:
validate
in classPath
- Parameters:
ctx
-APIContext
- Returns:
- true if the player can walk along this path, false otherwise
-
getNext
public Tile getNext(APIContext ctx)
Description copied from class:Path
Gets the next available tile in this path.- Specified by:
getNext
in classPath
- Parameters:
ctx
-APIContext
- Returns:
- the next tile or null
-
setStart
public void setStart(Tile start)
-
getStart
public Tile getStart()
Description copied from class:Path
Gets the start tile of this path.
-
-