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 aGraphInstructions
record class. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the value of theactionCost
record component.actions()
Returns the value of theactions
record component.Returns the value of theblockPosition
record component.int
Returns the value of thedeltaUsableBlockItems
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of themoveDirection
record component.boolean
Returns the value of therequiresOneBlock
record component.final String
toString()
Returns a string representation of this record class.@NotNull GraphInstructions
withActionCost
(double actionCost) @NotNull GraphInstructions
withActions
(List<WorldAction> actions) @NotNull GraphInstructions
withBlockPosition
(SFVec3i blockPosition) @NotNull GraphInstructions
withDeltaUsableBlockItems
(int deltaUsableBlockItems) @NotNull GraphInstructions
withMoveDirection
(ActionDirection moveDirection) @NotNull GraphInstructions
withRequiresOneBlock
(boolean requiresOneBlock)
-
Constructor Details
-
GraphInstructions
public GraphInstructions(SFVec3i blockPosition, int deltaUsableBlockItems, boolean requiresOneBlock, ActionDirection moveDirection, double actionCost, List<WorldAction> actions) Creates an instance of aGraphInstructions
record class.- Parameters:
blockPosition
- the value for theblockPosition
record componentdeltaUsableBlockItems
- the value for thedeltaUsableBlockItems
record componentrequiresOneBlock
- the value for therequiresOneBlock
record componentmoveDirection
- the value for themoveDirection
record componentactionCost
- the value for theactionCost
record componentactions
- the value for theactions
record component
-
-
Method Details
-
withBlockPosition
- Returns:
this
.
-
withDeltaUsableBlockItems
- Returns:
this
.
-
withRequiresOneBlock
- Returns:
this
.
-
withMoveDirection
- Returns:
this
.
-
withActionCost
- Returns:
this
.
-
withActions
- Returns:
this
.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
blockPosition
Returns the value of theblockPosition
record component.- Returns:
- the value of the
blockPosition
record component
-
deltaUsableBlockItems
public int deltaUsableBlockItems()Returns the value of thedeltaUsableBlockItems
record component.- Returns:
- the value of the
deltaUsableBlockItems
record component
-
requiresOneBlock
public boolean requiresOneBlock()Returns the value of therequiresOneBlock
record component.- Returns:
- the value of the
requiresOneBlock
record component
-
moveDirection
Returns the value of themoveDirection
record component.- Returns:
- the value of the
moveDirection
record component
-
actionCost
public double actionCost()Returns the value of theactionCost
record component.- Returns:
- the value of the
actionCost
record component
-
actions
Returns the value of theactions
record component.- Returns:
- the value of the
actions
record component
-