Class CustomWebPath
- java.lang.Object
-
- org.dreambot.api.methods.walking.web.node.CustomWebPath
-
public class CustomWebPath extends java.lang.ObjectCustomWebPath is a helper class that makes creating and attaching custom web nodes to our standard web nodes easier
-
-
Constructor Summary
Constructors Constructor Description CustomWebPath(boolean connect, AbstractWebNode... nodes)Adds each web node to this custom web node path If connect is true, each node will have a two way connection to the previous nodeCustomWebPath(Tile... tiles)Creates a newBasicWebNodefor each Tile with two way connections between each nodeCustomWebPath(AbstractWebNode... nodes)seeCustomWebPath(boolean, AbstractWebNode...)with a default boolean of True
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddNode(Tile tile)seeaddNode(Tile, boolean)with default of TruevoidaddNode(Tile tile, boolean twoWay)Creates aBasicWebNodeand adds it to this custom web path usingaddNode(AbstractWebNode, boolean)voidaddNode(AbstractWebNode node)Adds a web node to this custom path usingaddNode(AbstractWebNode, boolean)with a default of TruevoidaddNode(AbstractWebNode node, boolean twoWay)Adds a web node to the end of this path's list.voidaddNodes(Tile... tiles)Adds each Tile usingaddNode(Tile, boolean)with a default of TruevoidaddNodes(AbstractWebNode... nodes)Adds each node usingaddNode(AbstractWebNode, boolean)with a default of TruevoidattachToWeb()Attaches this custom web path into the global webbooleanattachToWeb(boolean attachStart, boolean attachEnd)Attaches this custom web path into the global web Will automatically callconnectStartToClosestNode()andconnectEndToClosestNode()based on the parameters passedbooleanconnectEndToClosestNode()This will connect the end of this path to the nearest BasicWebNode whenattachToWeb()orWebFinder.addCustomWebPath(CustomWebPath)is calledbooleanconnectStartToClosestNode()This will connect the start of this path to the nearest BasicWebNode whenattachToWeb()orWebFinder.addCustomWebPath(CustomWebPath)is called for this path This will NOT cadd this path to the full global web.voidconnectToEnd(int nodeIndex)This will connect the end of this path to the provided node index whenattachToWeb()orWebFinder.addCustomWebPath(CustomWebPath)is called for this path This will NOT connect this path to the full global webvoidconnectToStart(int nodeIndex)This will connect the start of this path to the provided node index whenattachToWeb()orWebFinder.addCustomWebPath(CustomWebPath)is called for this path This will NOT add this path to the full global web.AbstractWebNodegetEnd()java.util.ArrayList<AbstractWebNode>getNodes()AbstractWebNodegetStart()
-
-
-
Constructor Detail
-
CustomWebPath
public CustomWebPath(Tile... tiles)
Creates a newBasicWebNodefor each Tile with two way connections between each node- Parameters:
tiles-Tiles to add to the custom web path
-
CustomWebPath
public CustomWebPath(AbstractWebNode... nodes)
seeCustomWebPath(boolean, AbstractWebNode...)with a default boolean of True
-
CustomWebPath
public CustomWebPath(boolean connect, AbstractWebNode... nodes)Adds each web node to this custom web node path If connect is true, each node will have a two way connection to the previous node- Parameters:
connect- If True will add two way connections, if False the connection will be one way from previous to currentnodes-AbstractWebNodenodes to add to this path
-
-
Method Detail
-
addNode
public void addNode(Tile tile)
seeaddNode(Tile, boolean)with default of True
-
addNodes
public void addNodes(Tile... tiles)
Adds each Tile usingaddNode(Tile, boolean)with a default of True
-
addNodes
public void addNodes(AbstractWebNode... nodes)
Adds each node usingaddNode(AbstractWebNode, boolean)with a default of True
-
addNode
public void addNode(Tile tile, boolean twoWay)
Creates aBasicWebNodeand adds it to this custom web path usingaddNode(AbstractWebNode, boolean)- Parameters:
tile- Tile to add as aBasicWebNodetwoWay- whether the connection should be two way or not to the current last node
-
addNode
public void addNode(AbstractWebNode node)
Adds a web node to this custom path usingaddNode(AbstractWebNode, boolean)with a default of True
-
addNode
public void addNode(AbstractWebNode node, boolean twoWay)
Adds a web node to the end of this path's list. If twoWay is true, it will do a two way connection to the previous node.- Parameters:
node-AbstractWebNodeto add to the end of the listtwoWay- boolean whether the connection should be two way or one way
-
connectToStart
public void connectToStart(int nodeIndex)
This will connect the start of this path to the provided node index whenattachToWeb()orWebFinder.addCustomWebPath(CustomWebPath)is called for this path This will NOT add this path to the full global web.- Parameters:
nodeIndex- The index of the AbstractWebNode to attach this path to
-
connectStartToClosestNode
public boolean connectStartToClosestNode()
This will connect the start of this path to the nearest BasicWebNode whenattachToWeb()orWebFinder.addCustomWebPath(CustomWebPath)is called for this path This will NOT cadd this path to the full global web.- Returns:
- true if there's a node within 32 tiles to attach it to, false otherwise
-
connectEndToClosestNode
public boolean connectEndToClosestNode()
This will connect the end of this path to the nearest BasicWebNode whenattachToWeb()orWebFinder.addCustomWebPath(CustomWebPath)is calledNote: This should only be called after all web nodes are added, otherwise it'll attach at the wrong point in your custom path This will NOT add this path to the full global web.
- Returns:
- true if there's a node within 32 tiles to attach it to, false otherwise
-
connectToEnd
public void connectToEnd(int nodeIndex)
This will connect the end of this path to the provided node index whenattachToWeb()orWebFinder.addCustomWebPath(CustomWebPath)is called for this path This will NOT connect this path to the full global web- Parameters:
nodeIndex- The index of the AbstractWebNode to attach this path to
-
getStart
public AbstractWebNode getStart()
-
getEnd
public AbstractWebNode getEnd()
-
getNodes
public java.util.ArrayList<AbstractWebNode> getNodes()
-
attachToWeb
public void attachToWeb()
Attaches this custom web path into the global web
-
attachToWeb
public boolean attachToWeb(boolean attachStart, boolean attachEnd)Attaches this custom web path into the global web Will automatically callconnectStartToClosestNode()andconnectEndToClosestNode()based on the parameters passed- Parameters:
attachStart-attachEnd-- Returns:
- False if attach start is requested and fails, false if attach end is requested and fails, else true
-
-