Package ruscz.game.gameOfProd.Scripts
Class PathFinder
- java.lang.Object
-
- ruscz.game.gameOfProd.Scripts.PathFinder
-
public class PathFinder extends java.lang.ObjectThis class handles translation between the output of A* algorithm and our internal movement directions
-
-
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
-
-
-
Field Detail
-
map
private final Map map
-
MAX_STEPS
private static final int MAX_STEPS
- See Also:
- Constant Field Values
-
-
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 valuestartY- is starting Y valueendX- is ending X valueendY- is ending Y value- Returns:
- list of directions for NPC
-
-