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
ConstructorDescriptionPathVector
(double cost, org.bukkit.util.Vector vector) Creates a new PathVector object. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(@NotNull PathVector vector) Compares thisPathVector
to another.double
getCost()
Gets the cost of thisPathVector
.org.bukkit.util.Vector
Gets theVector
of thisPathVector
.
-
Constructor Details
-
PathVector
public PathVector(double cost, org.bukkit.util.Vector vector) Creates a new PathVector object.- Parameters:
cost
- The cost of thisPathVector
as 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 theVector
of thisPathVector
.- Returns:
- The
Vector
.
-
compareTo
Compares thisPathVector
to another. This is based on cost.- Specified by:
compareTo
in interfaceComparable<PathVector>
- Parameters:
vector
- ThePathVector
we're comparing this one to.- Returns:
- -1, 0, 1 based on less than, equal to, or greater than
-