Class AStarAlgorithm
java.lang.Object
net.glowstone.util.pathfinding.algorithms.AStarAlgorithm
- All Implemented Interfaces:
IAlgorithm
An implementation of
IAlgorithm
for A* Pathfinding.-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.glowstone.util.pathfinding.IAlgorithm
getCornerNeighbors, getFaceNeighbors, getNeighbors
-
Constructor Details
-
AStarAlgorithm
public AStarAlgorithm()
-
-
Method Details
-
calculatePath
public List<org.bukkit.util.Vector> calculatePath(GlowBlock startPoint, GlowBlock endPoint, Map<org.bukkit.Material, Double> materialWeights, org.bukkit.Material... blockedMaterials) Thanks to www.redblobgames.com/pathfinding/a-star/implementation.html- Specified by:
calculatePath
in interfaceIAlgorithm
- Parameters:
startPoint
- The starting position.endPoint
- The ending position.materialWeights
- A map containing amaterial
key, with acost
as the value.blockedMaterials
- A varargs ofmaterials
that should be blocked from pathing.- Returns:
- A list of
Vectors
that make up the path found during calculation.
-