Class JumpPointSearch

  • All Implemented Interfaces:
    Pathfinder

    public class JumpPointSearch
    extends AStar
    Jump Point Search algorithm.
    • Constructor Detail

      • JumpPointSearch

        public JumpPointSearch()
    • Method Detail

      • buildPath

        public void buildPath​(Node node,
                              int[][] map)
        Description copied from interface: Pathfinder
        Draws the path found by the algorithm to the map provided.
        Parameters:
        node - The end node of the path
        map - The map to draw the path into
      • getDistanceBetween

        protected float getDistanceBetween​(Node first,
                                           Node second)
        Description copied from class: Dijkstra
        Calculates the distance between two nodes.
        Overrides:
        getDistanceBetween in class Dijkstra
        Parameters:
        first - first node
        second - second node
        Returns:
        distance between the given nodes
      • getSuccessors

        protected Node[] getSuccessors​(Node node)
        Finds jump points.
        Overrides:
        getSuccessors in class Dijkstra
        Parameters:
        node - the parent node
        Returns:
        list of nodes that can be moved into from the parent node