Package me.nabdev.pathfinding.algorithms
Class Astar
java.lang.Object
me.nabdev.pathfinding.algorithms.Astar
- All Implemented Interfaces:
SearchAlgorithm
A class to represent all the logic behind the A* pathfinding algorithm.
-
Nested Class Summary
Nested classes/interfaces inherited from interface me.nabdev.pathfinding.algorithms.SearchAlgorithm
SearchAlgorithm.SearchAlgorithmType
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Astar
Creates a new Astar object.- Parameters:
pathfinder
- The Pathfinder object that created this Astar object.
-
-
Method Details
-
run
Runs the A* algorithm.- Specified by:
run
in interfaceSearchAlgorithm
- Parameters:
start
- The starting point.end
- The target point.- Returns:
- A Path object containing the path from the start to the target.
- Throws:
ImpossiblePathException
- If there is no possible path from the start
-