Class TilePath
- java.lang.Object
-
- com.epicbot.api.shared.model.path.Path
-
- com.epicbot.api.shared.model.path.TilePath
-
- Direct Known Subclasses:
ScreenPath
public class TilePath extends Path
Walks a path using the mini-map.
-
-
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()
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)
-
Methods inherited from class com.epicbot.api.shared.model.path.Path
enableRun, getPrecision
-
-
-
-
Field Detail
-
tiles
protected Tile[] tiles
-
-
Constructor Detail
-
TilePath
public TilePath(Tile... tiles)
Construct a new path.- Parameters:
tiles
- the tiles to walk on
-
TilePath
public TilePath(double precision, Tile... tiles)
Construct a new path.- Parameters:
precision
- how far off the destination this path is considered completedtiles
- the tiles to walk on
-
-
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
-
getStart
public Tile getStart()
Description copied from class:Path
Gets the start tile of this path.
-
walk
protected boolean walk(APIContext ctx, Tile next)
-
randomize
public TilePath randomize(int maxX, int maxY)
-
reversed
public TilePath reversed()
-
-