Class WebFinder
- java.lang.Object
-
- org.dreambot.api.methods.walking.pathfinding.impl.PathFinder<AbstractWebNode>
-
- org.dreambot.api.methods.walking.pathfinding.impl.web.WebFinder
-
public class WebFinder extends PathFinder<AbstractWebNode>
Created with IntelliJ IDEA.- Since:
- : 1/9/2015 Time : 8:22 PM
-
-
Constructor Summary
Constructors Constructor Description WebFinder()
Initializes a new web finder, loading web nodes and initializing allowed node types
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAllowedTypes(WebNodeType... types)
Add allowed types of web nodes to acceptable nodes list.void
addCustomWebPath(CustomWebPath customWebPath)
boolean
addNode(Tile newNodeTarget)
void
addWebNode(AbstractWebNode node)
GlobalPath<AbstractWebNode>
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)GlobalPath<AbstractWebNode>
calculate(Tile start, Tile destination)
Calculates an AbstractPath from Tile s to Tile eGlobalPath<AbstractWebNode>
calculate(AbstractWebNode start, AbstractWebNode destination)
void
clearCustomNodes()
AbstractWebNode
get(int index)
int
getId(AbstractWebNode abstractWebNode)
AbstractWebNode
getNearest(Tile target, int threshold)
Gets the closest web node to for given argument.AbstractWebNode
getNearest(AbstractWebNode target)
Gets the closest web (default 5 tile threshold) node for the given argument.AbstractWebNode
getNearest(AbstractWebNode target, int threshold)
Gets the closest web node to for given argument.java.util.ArrayList<AbstractWebNode>
getNodesWithin(int dist, Tile t)
static boolean
isLoaded()
Checks if the base web nodes have been loaded into the clientstatic void
loadWebNodes()
void
removeAllowedTypes(WebNodeType... types)
Remove allowed types of web nodes from acceptable nodes list.void
removeNode(int idx)
void
resetWebNodes()
-
Methods inherited from class org.dreambot.api.methods.walking.pathfinding.impl.PathFinder
addBlacklistedTile, addObstacle, calculate, calculate, clearBlacklist, getDirection, getMovementCost, getNode, getObstacle, hasObstacle, isBlacklisted, isDirWall, removeObstacle, reset
-
-
-
-
Method Detail
-
loadWebNodes
public static void loadWebNodes()
-
isLoaded
public static boolean isLoaded()
Checks if the base web nodes have been loaded into the client- Returns:
- true if loaded, false if still loading
-
calculate
public GlobalPath<AbstractWebNode> 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)- Specified by:
calculate
in classPathFinder<AbstractWebNode>
- 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
-
calculate
public GlobalPath<AbstractWebNode> calculate(Tile start, Tile destination)
Description copied from class:PathFinder
Calculates an AbstractPath from Tile s to Tile e- Overrides:
calculate
in classPathFinder<AbstractWebNode>
- Parameters:
start
- Start Tiledestination
- End Tile- Returns:
- AbstractPath
-
calculate
public GlobalPath<AbstractWebNode> calculate(AbstractWebNode start, AbstractWebNode destination)
-
addAllowedTypes
public void addAllowedTypes(WebNodeType... types)
Add allowed types of web nodes to acceptable nodes list.- Parameters:
types
- the allowed types of nodes you wish to add to the acceptable list.
-
removeAllowedTypes
public void removeAllowedTypes(WebNodeType... types)
Remove allowed types of web nodes from acceptable nodes list.- Parameters:
types
- the allowed types of nodes you wish to remove from the acceptable list.
-
getNearest
public AbstractWebNode getNearest(AbstractWebNode target)
Gets the closest web (default 5 tile threshold) node for the given argument.- Parameters:
target
- the target you wish to find the nearest web node of.- Returns:
- the closest web node to the given tile if found, otherwise null.
-
getNearest
public AbstractWebNode getNearest(AbstractWebNode target, int threshold)
Gets the closest web node to for given argument.- Parameters:
target
- the target you wish to find the nearest web node of.threshold
- the threshold of search you would like to perform.- Returns:
- the closest web node to the given tile if found, otherwise null.
-
getNearest
public AbstractWebNode getNearest(Tile target, int threshold)
Gets the closest web node to for given argument.- Parameters:
target
- the target you wish to find the nearest web node of.threshold
- the threshold of search you would like to perform.- Returns:
- the closest web node to the given tile if found, otherwise null.
-
addNode
public boolean addNode(Tile newNodeTarget)
-
getNodesWithin
public java.util.ArrayList<AbstractWebNode> getNodesWithin(int dist, Tile t)
-
removeNode
public void removeNode(int idx)
-
clearCustomNodes
public void clearCustomNodes()
-
addCustomWebPath
public void addCustomWebPath(CustomWebPath customWebPath)
-
getId
public int getId(AbstractWebNode abstractWebNode)
-
addWebNode
public void addWebNode(AbstractWebNode node)
-
get
public AbstractWebNode get(int index)
-
resetWebNodes
public void resetWebNodes()
-
-