Class AttributeModifier<T extends Number>
java.lang.Object
com.github.darksoulq.abyssallib.world.data.attribute.AttributeModifier<T>
- Type Parameters:
T- The numeric type of the attribute being modified, extendingNumber.
-
Constructor Summary
ConstructorsConstructorDescriptionAttributeModifier(T value, AttributeOperation operation) Constructs a new attribute modifier with a specific value and operation type. -
Method Summary
Modifier and TypeMethodDescriptionapplyToBigDecimal(BigDecimal base) Applies this modifier to aBigDecimalbase value for high-precision arithmetic.byteapplyToByte(byte base) Applies this modifier to a byte base value.doubleapplyToDouble(double base) Applies this modifier to a double-precision base value.floatapplyToFloat(float base) Applies this modifier to a floating-point base value.intapplyToInt(int base) Applies this modifier to an integer base value.longapplyToLong(long base) Applies this modifier to a long integer base value.shortapplyToShort(short base) Applies this modifier to a short integer base value.Retrieves the specific arithmetic operation performed by this modifier.getValue()Retrieves the raw numeric value associated with this modifier.
-
Constructor Details
-
AttributeModifier
Constructs a new attribute modifier with a specific value and operation type.- Parameters:
value- The numeric value to apply as a modifier.operation- TheAttributeOperationdefining how the value interacts with the base.
-
-
Method Details
-
getValue
Retrieves the raw numeric value associated with this modifier.- Returns:
- The modifier value of type
T.
-
getOperation
Retrieves the specific arithmetic operation performed by this modifier.- Returns:
- The
AttributeOperationconstant representing the operation.
-
applyToInt
public int applyToInt(int base) Applies this modifier to an integer base value.- Parameters:
base- The original base value to be modified.- Returns:
- The resulting modified integer value.
-
applyToFloat
public float applyToFloat(float base) Applies this modifier to a floating-point base value.- Parameters:
base- The original base value to be modified.- Returns:
- The resulting modified float value.
-
applyToDouble
public double applyToDouble(double base) Applies this modifier to a double-precision base value.- Parameters:
base- The original base value to be modified.- Returns:
- The resulting modified double value.
-
applyToLong
public long applyToLong(long base) Applies this modifier to a long integer base value.- Parameters:
base- The original base value to be modified.- Returns:
- The resulting modified long value.
-
applyToShort
public short applyToShort(short base) Applies this modifier to a short integer base value.- Parameters:
base- The original base value to be modified.- Returns:
- The resulting modified short value.
-
applyToByte
public byte applyToByte(byte base) Applies this modifier to a byte base value.- Parameters:
base- The original base value to be modified.- Returns:
- The resulting modified byte value.
-
applyToBigDecimal
Applies this modifier to aBigDecimalbase value for high-precision arithmetic.- Parameters:
base- The original base value to be modified.- Returns:
- The resulting modified BigDecimal value.
-