Record Class GoalBlock
java.lang.Object
java.lang.Record
com.zenith.feature.pathfinder.goals.GoalBlock
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doublecalculate(double xDiff, int yDiff, double zDiff) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doubleheuristic(int x, int y, int z) booleanisInGoal(int x, int y, int z) final StringtoString()Returns a string representation of this record class.intx()Returns the value of thexrecord component.inty()Returns the value of theyrecord component.intz()Returns the value of thezrecord component.
-
Constructor Details
-
GoalBlock
-
GoalBlock
public GoalBlock(int x, int y, int z) Creates an instance of aGoalBlockrecord class.- Parameters:
x- the value for thexrecord componenty- the value for theyrecord componentz- the value for thezrecord component
-
-
Method Details
-
isInGoal
-
heuristic
-
calculate
public static double calculate(double xDiff, int yDiff, double zDiff) -
getGoalPos
- Specified by:
getGoalPosin interfacePosGoal
-
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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
x
public int x()Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
y
public int y()Returns the value of theyrecord component.- Returns:
- the value of the
yrecord component
-
z
public int z()Returns the value of thezrecord component.- Returns:
- the value of the
zrecord component
-