Package net.glowstone.util.pathfinding
Class PathVector
java.lang.Object
net.glowstone.util.pathfinding.PathVector
- All Implemented Interfaces:
Comparable<PathVector>
A vector contained in part of a path, which is comparable based on its
pathfinding cost.
-
Constructor Summary
ConstructorsConstructorDescriptionPathVector(double cost, org.bukkit.util.Vector vector) Creates a new PathVector object. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(@NotNull PathVector vector) Compares thisPathVectorto another.doublegetCost()Gets the cost of thisPathVector.org.bukkit.util.VectorGets theVectorof thisPathVector.
-
Constructor Details
-
PathVector
public PathVector(double cost, org.bukkit.util.Vector vector) Creates a new PathVector object.- Parameters:
cost- The cost of thisPathVectoras determined during calculation.vector- The vector of thisPathVector.
-
-
Method Details
-
getCost
public double getCost()Gets the cost of thisPathVector.- Returns:
- The cost.
-
getVector
public org.bukkit.util.Vector getVector()Gets theVectorof thisPathVector.- Returns:
- The
Vector.
-
compareTo
Compares thisPathVectorto another. This is based on cost.- Specified by:
compareToin interfaceComparable<PathVector>- Parameters:
vector- ThePathVectorwe're comparing this one to.- Returns:
- -1, 0, 1 based on less than, equal to, or greater than
-