Class WebFinder

    • Constructor Detail

      • WebFinder

        public WebFinder()
        Initializes a new web finder, loading web nodes and initializing allowed node types
    • Method Detail

      • loadWebNodes

        public static void loadWebNodes()
      • 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 class PathFinder<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
      • 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)
      • 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
      • resetWebNodes

        public void resetWebNodes()