Class Path
- java.lang.Object
-
- com.epicbot.api.shared.model.path.Path
-
-
Constructor Summary
Constructors Constructor Description Path(double precision)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
enableRun(APIContext ctx)
abstract Tile
getEnd()
Gets the end tile of this path.abstract Tile
getNext(APIContext ctx)
Gets the next available tile in this path.double
getPrecision()
Gets the allowed precision of this path.abstract Tile
getStart()
Gets the start tile of this path.abstract Tile[]
getTiles()
abstract boolean
traverse(APIContext ctx)
Takes a step along this path if appropriate.abstract boolean
traverse(APIContext ctx, boolean enableRun)
Takes a step along this path if appropriate.abstract boolean
validate(APIContext ctx)
Checks whether or not this path can be traversed by the player.
-
-
-
Method Detail
-
traverse
public abstract boolean traverse(APIContext ctx)
Takes a step along this path if appropriate.- 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 abstract boolean traverse(APIContext ctx, boolean enableRun)
Takes a step along this path if appropriate.- Parameters:
ctx
-APIContext
enableRun
- 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 abstract boolean validate(APIContext ctx)
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.- Parameters:
ctx
-APIContext
- Returns:
- true if the player can walk along this path, false otherwise
-
getNext
public abstract Tile getNext(APIContext ctx)
Gets the next available tile in this path.- Parameters:
ctx
-APIContext
- Returns:
- the next tile or null
-
getStart
public abstract Tile getStart()
Gets the start tile of this path.- Returns:
- the start tile
-
getEnd
public abstract Tile getEnd()
Gets the end tile of this path.- Returns:
- the end tile
-
getTiles
public abstract Tile[] getTiles()
-
getPrecision
public double getPrecision()
Gets the allowed precision of this path. For example: with a precision of 2 the path will not be traversed if the player is 2 'tiles' from the destination.- Returns:
- the path precision
-
enableRun
protected void enableRun(APIContext ctx)
-
-