Record Class GraphInstructions
java.lang.Object
java.lang.Record
com.soulfiremc.server.pathfinding.graph.GraphInstructions
public record GraphInstructions(SFVec3i blockPosition, int deltaUsableBlockItems, boolean requiresOneBlock, ActionDirection moveDirection, double actionCost, List<WorldAction> actions)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionGraphInstructions(SFVec3i blockPosition, int deltaUsableBlockItems, boolean requiresOneBlock, ActionDirection moveDirection, double actionCost, List<WorldAction> actions) Creates an instance of aGraphInstructionsrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of theactionCostrecord component.actions()Returns the value of theactionsrecord component.Returns the value of theblockPositionrecord component.intReturns the value of thedeltaUsableBlockItemsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themoveDirectionrecord component.booleanReturns the value of therequiresOneBlockrecord component.final StringtoString()Returns a string representation of this record class.@NotNull GraphInstructionswithActionCost(double actionCost) @NotNull GraphInstructionswithActions(List<WorldAction> actions) @NotNull GraphInstructionswithBlockPosition(SFVec3i blockPosition) @NotNull GraphInstructionswithDeltaUsableBlockItems(int deltaUsableBlockItems) @NotNull GraphInstructionswithMoveDirection(ActionDirection moveDirection) @NotNull GraphInstructionswithRequiresOneBlock(boolean requiresOneBlock)
-
Constructor Details
-
GraphInstructions
public GraphInstructions(SFVec3i blockPosition, int deltaUsableBlockItems, boolean requiresOneBlock, ActionDirection moveDirection, double actionCost, List<WorldAction> actions) Creates an instance of aGraphInstructionsrecord class.- Parameters:
blockPosition- the value for theblockPositionrecord componentdeltaUsableBlockItems- the value for thedeltaUsableBlockItemsrecord componentrequiresOneBlock- the value for therequiresOneBlockrecord componentmoveDirection- the value for themoveDirectionrecord componentactionCost- the value for theactionCostrecord componentactions- the value for theactionsrecord component
-
-
Method Details
-
withBlockPosition
- Returns:
this.
-
withDeltaUsableBlockItems
- Returns:
this.
-
withRequiresOneBlock
- Returns:
this.
-
withMoveDirection
- Returns:
this.
-
withActionCost
- Returns:
this.
-
withActions
- Returns:
this.
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
blockPosition
Returns the value of theblockPositionrecord component.- Returns:
- the value of the
blockPositionrecord component
-
deltaUsableBlockItems
public int deltaUsableBlockItems()Returns the value of thedeltaUsableBlockItemsrecord component.- Returns:
- the value of the
deltaUsableBlockItemsrecord component
-
requiresOneBlock
public boolean requiresOneBlock()Returns the value of therequiresOneBlockrecord component.- Returns:
- the value of the
requiresOneBlockrecord component
-
moveDirection
Returns the value of themoveDirectionrecord component.- Returns:
- the value of the
moveDirectionrecord component
-
actionCost
public double actionCost()Returns the value of theactionCostrecord component.- Returns:
- the value of the
actionCostrecord component
-
actions
Returns the value of theactionsrecord component.- Returns:
- the value of the
actionsrecord component
-