Class AbstractWebNode

    • 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.
      • addDualConnections

        public void addDualConnections​(AbstractWebNode... nodes)
        Adds a two-way connection between this node and each of the given nodes.
        Parameters:
        nodes - the nodes to connect to this node
      • addOutgoingConnections

        public void addOutgoingConnections​(AbstractWebNode... connections)
        Adds outgoing connections from this node to the given list of nodes. Does NOT connect the given list of nodes to this node. ONE WAY connection.
      • addIncomingConnections

        public void addIncomingConnections​(AbstractWebNode... connections)
        Adds incoming connections from the given nodes to this node Does NOT connect this node to the given list of nodes. ONE WAY connection.
      • removeConnections

        public void removeConnections​(AbstractWebNode... connections)
        Removes the given nodes from this node's connections. ONE WAY REMOVAL, does NOT remove this connection from the given nodes
      • removeDualConnections

        public void removeDualConnections​(AbstractWebNode... connections)
        Removes the given nodes from this node's connections and removes this node from the given nodes' connections TWO WAY REMOVAL
      • clear

        public void clear()
      • 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.
      • getRequiredItems

        public java.util.List<RequiredItem> getRequiredItems()