Class PathVector

java.lang.Object
net.glowstone.util.pathfinding.PathVector
All Implemented Interfaces:
Comparable<PathVector>

public class PathVector extends Object implements Comparable<PathVector>
A vector contained in part of a path, which is comparable based on its pathfinding cost.
  • Constructor Details

    • PathVector

      public PathVector(double cost, org.bukkit.util.Vector vector)
      Creates a new PathVector object.
      Parameters:
      cost - The cost of this PathVector as determined during calculation.
      vector - The vector of this PathVector.
  • Method Details

    • getCost

      public double getCost()
      Gets the cost of this PathVector.
      Returns:
      The cost.
    • getVector

      public org.bukkit.util.Vector getVector()
      Gets the Vector of this PathVector.
      Returns:
      The Vector.
    • compareTo

      public int compareTo(@NotNull @NotNull PathVector vector)
      Compares this PathVector to another. This is based on cost.
      Specified by:
      compareTo in interface Comparable<PathVector>
      Parameters:
      vector - The PathVector we're comparing this one to.
      Returns:
      -1, 0, 1 based on less than, equal to, or greater than