Class AStarNode

java.lang.Object
com.hypixel.hytale.server.npc.navigation.AStarNode
All Implemented Interfaces:
IWaypoint

public class AStarNode extends Object implements IWaypoint
  • Field Details

    • ENTRY_NODE_TAG

      public static final AStarNode ENTRY_NODE_TAG
    • position

      @Nonnull protected final Vector3d position
    • travelCost

      protected float travelCost
    • estimateToGoal

      protected float estimateToGoal
    • totalCost

      protected float totalCost
    • predecessor

      @Nullable protected AStarNode predecessor
    • predecessorDirection

      protected int predecessorDirection
    • successors

      @Nonnull protected final AStarNode[] successors
    • stepCost

      @Nonnull protected final float[] stepCost
    • nextPathNode

      protected AStarNode nextPathNode
    • length

      protected int length
    • positionIndex

      protected long positionIndex
    • open

      protected boolean open
  • Constructor Details

    • AStarNode

      public AStarNode(int numDirections)
  • Method Details

    • getPositionIndex

      public long getPositionIndex()
    • getSuccessors

      @Nonnull public AStarNode[] getSuccessors()
    • getSuccessor

      public AStarNode getSuccessor(int index)
    • setSuccessor

      public void setSuccessor(int directionIndex, @Nonnull AStarNode node, int inverseDirectionIndex, float cost)
    • getPredecessor

      @Nullable public AStarNode getPredecessor()
    • getNextPathNode

      public AStarNode getNextPathNode()
    • setNextNode

      public void setNextNode(AStarNode next, int length)
    • getTravelCost

      public float getTravelCost()
    • getEstimateToGoal

      public float getEstimateToGoal()
    • getTotalCost

      public float getTotalCost()
    • getPredecessorDirection

      public int getPredecessorDirection()
    • close

      public void close()
    • isOpen

      public boolean isOpen()
    • isInvalid

      public boolean isInvalid()
    • getLength

      public int getLength()
      Specified by:
      getLength in interface IWaypoint
    • next

      public AStarNode next()
      Specified by:
      next in interface IWaypoint
    • getPosition

      @Nonnull public Vector3d getPosition()
      Specified by:
      getPosition in interface IWaypoint
    • advance

      @Nullable public AStarNode advance(int skip)
      Specified by:
      advance in interface IWaypoint
    • initAsStartNode

      @Nonnull public AStarNode initAsStartNode(@Nonnull Vector3d position, long positionIndex, float cost, float estimateCost)
    • initWithPredecessor

      @Nonnull public AStarNode initWithPredecessor(@Nonnull AStarNode predecessor, int directionIndex, @Nonnull Vector3d position, long positionIndex, int inverseDirectionIndex, float travelCost, float estimateCost)
    • initAsInvalid

      @Nonnull public AStarNode initAsInvalid(@Nonnull Vector3d position, long positionIndex)
    • adjustOptimalPath

      public void adjustOptimalPath(AStarNode parentNode, float deltaCost, int direction)
    • toString

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