Class ConstantScaling
java.lang.Object
io.artificial.enchantments.api.scaling.ConstantScaling
- All Implemented Interfaces:
LevelScaling
A scaling algorithm that returns a constant value regardless of level.
- Since:
- 0.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionConstantScaling(double value) Creates a new constant scaling with the specified value. -
Method Summary
-
Constructor Details
-
ConstantScaling
public ConstantScaling(double value) Creates a new constant scaling with the specified value.- Parameters:
value- the constant value to return for all levels
-
-
Method Details
-
calculate
public double calculate(int level) Description copied from interface:LevelScalingCalculates the scaled value for a given enchantment level.- Specified by:
calculatein interfaceLevelScaling- Parameters:
level- the enchantment level (>= 1)- Returns:
- the calculated value
-
getValue
public double getValue()Gets the constant value.- Returns:
- the value
-
toString
-