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, waitMethods 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:
calculatePathin interfaceIAlgorithm- Parameters:
startPoint- The starting position.endPoint- The ending position.materialWeights- A map containing amaterialkey, with acostas the value.blockedMaterials- A varargs ofmaterialsthat should be blocked from pathing.- Returns:
- A list of
Vectorsthat make up the path found during calculation.
-