Package me.qscbm.inlayx.talisman
Record Class TalismanFunction
java.lang.Object
java.lang.Record
me.qscbm.inlayx.talisman.TalismanFunction
- Record Components:
successRateBonus- 镶嵌成功率加成 (0~1)preventDestroy- 镶嵌失败时保护宝石不碎裂
保护符的功能配置.
-
Constructor Summary
ConstructorsConstructorDescriptionTalismanFunction(double successRateBonus, boolean preventDestroy) Creates an instance of aTalismanFunctionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic TalismanFunctionempty()final booleanIndicates whether some other object is "equal to" this one.boolean是否配置了至少一种功能.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thepreventDestroyrecord component.doubleReturns the value of thesuccessRateBonusrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TalismanFunction
public TalismanFunction(double successRateBonus, boolean preventDestroy) Creates an instance of aTalismanFunctionrecord class.- Parameters:
successRateBonus- the value for thesuccessRateBonusrecord componentpreventDestroy- the value for thepreventDestroyrecord component
-
-
Method Details
-
empty
-
hasAnyEffect
public boolean hasAnyEffect()是否配置了至少一种功能. -
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 '=='. -
successRateBonus
public double successRateBonus()Returns the value of thesuccessRateBonusrecord component.- Returns:
- the value of the
successRateBonusrecord component
-
preventDestroy
public boolean preventDestroy()Returns the value of thepreventDestroyrecord component.- Returns:
- the value of the
preventDestroyrecord component
-