Class AbstractWebNode

    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractWebNode​(int x, int y, int z)  
      AbstractWebNode​(org.dreambot.internal.web.WebNodes.WebNode node)
      This shouldn't be used by end users, it's used to load our internal web.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addConnections​(AbstractWebNode... connections)  
      double distance​(Tile tile)
      Distance (as the crow flies) away from the given tile.
      boolean equals​(java.lang.Object obj)  
      boolean execute()
      This is called by the walker to handle the actual walking, entity handling, or whatever else needed to get past this node.
      boolean forceNext()
      This is used to see if the walker should execute() this node even if there's a web node further along the GlobalPath that it can reach.
      java.util.List<AbstractWebNode> getConnections()  
      int getGridX()
      Gets grid (local) X coordinate of the given object.
      int getGridY()
      Gets grid (local) Y coordinate of the given object.
      int getIndex()  
      Tile getTile()
      Gets tile of the object.
      TileReference getTileReference()
      Gets tile reference of the given object.
      WebNodeType getType()
      Returns the WebNodeType of this node, used during path finding to ensure they're not disabled by the script
      int getWeight()
      Returns the extra weight added to the cost of this web node during path finding
      int getX()
      Gets X coordinate of the given object.
      int getY()
      Gets Y coordinate of the given object.
      int getZ()
      Gets Z coordinate of the given object.
      int hashCode()  
      boolean hasRequirements()
      This is used to determine during path finding if the current player can use this node
      boolean isValid()
      Checks the validity of this web node to see if it should be considered at all during path finding
      void removeConnections​(AbstractWebNode... connections)  
      void setConnections​(java.util.List<AbstractWebNode> connections)  
      void setWeight​(int weight)
      Sets the extra weight added to the cost of this web node during path finding
      java.lang.String toString()  
      double walkingDistance​(Tile tile)
      Walking distance based on pathfinding to the given tile.
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AbstractWebNode

        public AbstractWebNode​(int x,
                               int y,
                               int z)
      • AbstractWebNode

        public AbstractWebNode​(org.dreambot.internal.web.WebNodes.WebNode node)
        This shouldn't be used by end users, it's used to load our internal web.
    • Method Detail

      • getWeight

        public int getWeight()
        Returns the extra weight added to the cost of this web node during path finding
        Returns:
        the extra weight of this node
      • setWeight

        public void setWeight​(int weight)
        Sets the extra weight added to the cost of this web node during path finding

        The higher this is set, the more it costs during path finding

        Parameters:
        weight - the added cost for this node in approximate tiles
      • getType

        public WebNodeType getType()
        Returns the WebNodeType of this node, used during path finding to ensure they're not disabled by the script
        Returns:
        the type of web node
      • getX

        public int getX()
        Description copied from interface: Locatable
        Gets X coordinate of the given object.
        Specified by:
        getX in interface Locatable
        Returns:
        the X coordinate of the object.
      • hasRequirements

        public boolean hasRequirements()
        This is used to determine during path finding if the current player can use this node
        Returns:
        true if it's usable by the current player, false otherwise
      • getGridX

        public int getGridX()
        Description copied from interface: Locatable
        Gets grid (local) X coordinate of the given object.
        Specified by:
        getGridX in interface Locatable
        Returns:
        the grid X coordinate of the object.
      • getGridY

        public int getGridY()
        Description copied from interface: Locatable
        Gets grid (local) Y coordinate of the given object.
        Specified by:
        getGridY in interface Locatable
        Returns:
        the grid Y coordinate of the object.
      • getZ

        public int getZ()
        Description copied from interface: Locatable
        Gets Z coordinate of the given object.
        Specified by:
        getZ in interface Locatable
        Returns:
        the Z coordinate of the object.
      • distance

        public double distance​(Tile tile)
        Description copied from interface: Locatable
        Distance (as the crow flies) away from the given tile.
        Specified by:
        distance in interface Locatable
        Parameters:
        tile - the destination tile.
        Returns:
        return the distance from the given tile as a double.
      • getTile

        public Tile getTile()
        Description copied from interface: Locatable
        Gets tile of the object.
        Specified by:
        getTile in interface Locatable
        Returns:
        the object tile.
      • getTileReference

        public TileReference getTileReference()
        Description copied from interface: Locatable
        Gets tile reference of the given object.
        Specified by:
        getTileReference in interface Locatable
        Returns:
        the object tile reference.
      • getY

        public int getY()
        Description copied from interface: Locatable
        Gets Y coordinate of the given object.
        Specified by:
        getY in interface Locatable
        Returns:
        the Y coordinate of the object.
      • setConnections

        public void setConnections​(java.util.List<AbstractWebNode> connections)
      • addConnections

        public void addConnections​(AbstractWebNode... connections)
      • removeConnections

        public void removeConnections​(AbstractWebNode... connections)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getIndex

        public int getIndex()
      • execute

        public boolean execute()
        This is called by the walker to handle the actual walking, entity handling, or whatever else needed to get past this node.
        Returns:
        true if the node is successfully handled, false otherwise
      • forceNext

        public boolean forceNext()
        This is used to see if the walker should execute() this node even if there's a web node further along the GlobalPath that it can reach.

        This defaults to false, meaning that the walker can look for another web node further in the GlobalPath.

        Returns:
        true if the walker should execute this node next no matter what, false otherwise
      • isValid

        public boolean isValid()
        Checks the validity of this web node to see if it should be considered at all during path finding
        Returns:
        true if it's usable, false otherwise
      • walkingDistance

        public double walkingDistance​(Tile tile)
        Description copied from interface: Locatable
        Walking distance based on pathfinding to the given tile.

        This is a more expensive call than Locatable.distance(Tile), and should be used sparingly.

        Specified by:
        walkingDistance in interface Locatable
        Parameters:
        tile - the destination tile.
        Returns:
        return the path distance movement cost from the given tile as a double. If there isn't a path to the tile, it will return 3 times the as the crow flies distance.