Class DijkstraPathFinder


  • public class DijkstraPathFinder
    extends PathFinder<Tile>
    Created with IntelliJ IDEA.
    Since:
    : 3/28/2015 Time : 9:28 AM
    • Constructor Detail

      • DijkstraPathFinder

        public DijkstraPathFinder​(int maxDepth,
                                  boolean allowDiagonal)
        Creates a new path finder using Dijkstra's algorithm, adding "Staircase" and "Ladder" with "Climb-up" and "Climb-down" actions to possible obstacles.
        Parameters:
        maxDepth - Maximum depth we'll go before giving up
        allowDiagonal - True if you want to allow diagonals (should remain false)
    • Method Detail

      • calculate

        public LocalPath<Tile> calculate​(Tile start,
                                         Tile end)
        Description copied from class: PathFinder
        Calculates an AbstractPath from Tile s to Tile e
        Overrides:
        calculate in class PathFinder<Tile>
        Parameters:
        start - Start Tile
        end - End Tile
        Returns:
        AbstractPath
      • calculate

        public LocalPath<Tile> calculate​(int sx,
                                         int sy,
                                         int sz,
                                         int ex,
                                         int ey,
                                         int ez)
        Description copied from class: PathFinder
        Calculates an AbstracPath from the start location (x1,y1,z1) to the destination tile locaion (x2,y2,z2)
        Specified by:
        calculate in class PathFinder<Tile>
        Parameters:
        sx - the starting grid X coordinate.
        sy - the starting grid Y coordinate.
        sz - the starting grid Z coordinate.
        ex - the destination grid X coordinate.
        ey - the destination grid Y coordinate.
        ez - the destination grid Z coordinate
        Returns:
        AbstractPath
      • getCurrentDepth

        public int getCurrentDepth()
      • setCurrentDepth

        public void setCurrentDepth​(int currentDepth)