Class PathFinder<T extends Locatable>
- java.lang.Object
-
- org.dreambot.api.methods.walking.pathfinding.impl.PathFinder<T>
-
- Direct Known Subclasses:
AStarPathFinder
,DijkstraPathFinder
,WebFinder
public abstract class PathFinder<T extends Locatable> extends java.lang.Object
Created with IntelliJ IDEA.- Since:
- : 3/28/2015 Time : 9:16 AM
-
-
Constructor Summary
Constructors Constructor Description PathFinder()
PathFinder(int maxDepth, boolean allowDiagonal)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addBlacklistedTile(Tile t)
void
addObstacle(PathObstacle po)
****Used By Local Path Finders Only**** Adds an obstacle to the obstacle choices list.AbstractPath<T>
calculate(int x1, int y1, int x2, int y2)
Calculate a walkable abstract path from the start tile location (sx, sy) to the destination tile location (dx, dy), using data provided by the tile map.AbstractPath<T>
calculate(int x1, int y1, int x2, int y2, int z)
Calculate a walkable abstract path from the start tile location (x1, y1,z) to the destination tile location (x2, y2,z), using data provided by the tile map.abstract AbstractPath<T>
calculate(int x1, int y1, int z1, int x2, int y2, int z2)
Calculates an AbstracPath from the start location (x1,y1,z1) to the destination tile locaion (x2,y2,z2)AbstractPath<T>
calculate(Tile s, Tile e)
Calculates an AbstractPath from Tile s to Tile evoid
clearBlacklist()
java.lang.String
getDirection(int sx, int sy, int ex, int ey)
float
getMovementCost(int sx, int sy, int ex, int ey, int z)
PathNode
getNode(int x, int y, int z)
PathObstacle
getObstacle(int x, int y, int z, int dir)
boolean
hasObstacle(int x, int y, int z, int dir)
boolean
isBlacklisted(Tile t)
boolean
isDirWall(java.lang.String dir, int flag)
void
removeObstacle(PathObstacle obstacle)
****Used By Local Path Finders Only**** Removes the obstacle from the available obstacles of this pathfindervoid
reset()
-
-
-
Method Detail
-
addBlacklistedTile
public void addBlacklistedTile(Tile t)
-
isBlacklisted
public boolean isBlacklisted(Tile t)
-
clearBlacklist
public void clearBlacklist()
-
calculate
public AbstractPath<T> calculate(Tile s, Tile e)
Calculates an AbstractPath from Tile s to Tile e- Parameters:
s
- Start Tilee
- End Tile- Returns:
- AbstractPath
-
calculate
public AbstractPath<T> calculate(int x1, int y1, int x2, int y2)
Calculate a walkable abstract path from the start tile location (sx, sy) to the destination tile location (dx, dy), using data provided by the tile map. Assumes z coordinate is 0- Parameters:
x1
- the starting grid X coordinate.y1
- the starting grid Y coordinate.x2
- the destination grid X coordinate.y2
- the destination grid Y coordinate.- Returns:
- the abstract path from the start to destination if a path is found, if unable to find path it will return null.
-
calculate
public AbstractPath<T> calculate(int x1, int y1, int x2, int y2, int z)
Calculate a walkable abstract path from the start tile location (x1, y1,z) to the destination tile location (x2, y2,z), using data provided by the tile map.- Parameters:
x1
- the starting grid X coordinate.y1
- the starting grid Y coordinate.x2
- the destination grid X coordinate.y2
- the destination grid Y coordinate.z
- the z coordinate- Returns:
- the abstract path from the start to destination if a path is found, if unable to find path it will return null.
-
calculate
public abstract AbstractPath<T> calculate(int x1, int y1, int z1, int x2, int y2, int z2)
Calculates an AbstracPath from the start location (x1,y1,z1) to the destination tile locaion (x2,y2,z2)- Parameters:
x1
- the starting grid X coordinate.y1
- the starting grid Y coordinate.z1
- the starting grid Z coordinate.x2
- the destination grid X coordinate.y2
- the destination grid Y coordinate.z2
- the destination grid Z coordinate- Returns:
- AbstractPath
-
addObstacle
public void addObstacle(PathObstacle po)
****Used By Local Path Finders Only**** Adds an obstacle to the obstacle choices list. When creating the obstacle, give it the obstacle name, action, and then set the three Tile arguments to null.Local Path Finders are AStarPathFinder and DijkstraPathFinder
- Parameters:
po
-
-
removeObstacle
public void removeObstacle(PathObstacle obstacle)
****Used By Local Path Finders Only**** Removes the obstacle from the available obstacles of this pathfinderLocal Path Finders are AStarPathFinder and DijkstraPathFinder
- Parameters:
obstacle
- the obstacle to remove from the pathfinder
-
getMovementCost
public float getMovementCost(int sx, int sy, int ex, int ey, int z)
-
getNode
public PathNode getNode(int x, int y, int z)
-
hasObstacle
public boolean hasObstacle(int x, int y, int z, int dir)
-
getObstacle
public PathObstacle getObstacle(int x, int y, int z, int dir)
-
isDirWall
public boolean isDirWall(java.lang.String dir, int flag)
-
getDirection
public java.lang.String getDirection(int sx, int sy, int ex, int ey)
-
reset
public void reset()
-
-