Package emi.dev.emi.emi.bom
Record Class ChanceState
java.lang.Object
java.lang.Record
emi.dev.emi.emi.bom.ChanceState
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionChanceState(float chance, boolean chanced) Creates an instance of aChanceStaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatchance()Returns the value of thechancerecord component.booleanchanced()Returns the value of thechancedrecord component.consume(float chance) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.produce(float chance) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT
-
-
Constructor Details
-
ChanceState
public ChanceState(float chance, boolean chanced) Creates an instance of aChanceStaterecord class.- Parameters:
chance- the value for thechancerecord componentchanced- the value for thechancedrecord component
-
-
Method Details
-
produce
-
consume
-
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 '=='. -
chance
public float chance()Returns the value of thechancerecord component.- Returns:
- the value of the
chancerecord component
-
chanced
public boolean chanced()Returns the value of thechancedrecord component.- Returns:
- the value of the
chancedrecord component
-