Record Class ChangingSpread.Bounds
java.lang.Object
java.lang.Record
me.deecaad.weaponmechanics.weapon.shoot.spread.ChangingSpread.Bounds
- Enclosing class:
- ChangingSpread
public static record ChangingSpread.Bounds(boolean resetAfterReachingBound, double min, double max)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionBounds(boolean resetAfterReachingBound, double min, double max) Creates an instance of aBoundsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckBounds(HandData handData, double startingAmount) Checks bounds of spreadfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doublemax()Returns the value of themaxrecord component.doublemin()Returns the value of theminrecord component.booleanReturns the value of theresetAfterReachingBoundrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Bounds
public Bounds(boolean resetAfterReachingBound, double min, double max) Creates an instance of aBoundsrecord class.- Parameters:
resetAfterReachingBound- the value for theresetAfterReachingBoundrecord componentmin- the value for theminrecord componentmax- the value for themaxrecord component
-
-
Method Details
-
checkBounds
Checks bounds of spread- Returns:
- whether the spread change was reset
-
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. All components in this record class are compared with '=='. -
resetAfterReachingBound
public boolean resetAfterReachingBound()Returns the value of theresetAfterReachingBoundrecord component.- Returns:
- the value of the
resetAfterReachingBoundrecord component
-
min
public double min()Returns the value of theminrecord component.- Returns:
- the value of the
minrecord component
-
max
public double max()Returns the value of themaxrecord component.- Returns:
- the value of the
maxrecord component
-