Class PathFinder


  • public class PathFinder
    extends java.lang.Object
    This class handles translation between the output of A* algorithm and our internal movement directions
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Map map  
      private static int MAX_STEPS  
    • Constructor Summary

      Constructors 
      Constructor Description
      PathFinder​(Map map)  
    • Method Summary

      Modifier and Type Method Description
      java.util.LinkedList<Direction> getWayWithCollision​(int startX, int startY, int endX, int endY)
      Finds path with A* algorithm and translates it to directions using Direction enumeration
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PathFinder

        public PathFinder​(Map map)
    • Method Detail

      • getWayWithCollision

        public java.util.LinkedList<Direction> getWayWithCollision​(int startX,
                                                                   int startY,
                                                                   int endX,
                                                                   int endY)
        Finds path with A* algorithm and translates it to directions using Direction enumeration
        Parameters:
        startX - is starting X value
        startY - is starting Y value
        endX - is ending X value
        endY - is ending Y value
        Returns:
        list of directions for NPC