Class MinecraftRouteNode

java.lang.Object
com.soulfiremc.server.pathfinding.MinecraftRouteNode
All Implemented Interfaces:
Comparable<MinecraftRouteNode>

public final class MinecraftRouteNode extends Object implements Comparable<MinecraftRouteNode>
  • Constructor Details

    • MinecraftRouteNode

      public MinecraftRouteNode(NodeState node, List<WorldAction> actions, double sourceCost, double targetCost, double totalRouteScore)
    • MinecraftRouteNode

      public MinecraftRouteNode(NodeState node, @Nullable MinecraftRouteNode parent, @Nullable ActionDirection parentToNodeDirection, List<WorldAction> actions, double sourceCost, double targetCost, double totalRouteScore)
      Creates a new MinecraftRouteNode instance.
      Parameters:
      node - The world state of this node.
      parent - The currently best known node to this node.
      parentToNodeDirection - The direction from the parent to this node.
      actions - The actions from the previous node to this node that were used to get to this node.
      sourceCost - The cost of the route from the start node to this node.
      targetCost - The cost of the route from this node to the target.
      totalRouteScore - The estimated cost of the route from this node to the target + the source cost.
  • Method Details

    • compareTo

      public int compareTo(MinecraftRouteNode other)
      Specified by:
      compareTo in interface Comparable<MinecraftRouteNode>
    • setBetterParent

      public void setBetterParent(MinecraftRouteNode parent, ActionDirection moveDirection, List<WorldAction> actions, double sourceCost, double targetCost, double totalRouteScore)
    • node

      public NodeState node()
      The world state of this node.
    • parent

      public @Nullable MinecraftRouteNode parent()
      The currently best known node to this node.
    • parentToNodeDirection

      public @Nullable ActionDirection parentToNodeDirection()
      The direction from the parent to this node.
    • actions

      public List<WorldAction> actions()
      The actions from the previous node to this node that were used to get to this node.
    • sourceCost

      public double sourceCost()
      The cost of the route from the start node to this node.
    • targetCost

      public double targetCost()
      The cost of the route from this node to the target.
    • totalRouteScore

      public double totalRouteScore()
      The estimated cost of the route from this node to the target + the source cost.
    • toString

      @NotNull public @NotNull String toString()
      Overrides:
      toString in class Object