Class ConstantScaling

java.lang.Object
io.artificial.enchantments.api.scaling.ConstantScaling
All Implemented Interfaces:
LevelScaling

public final class ConstantScaling extends Object implements LevelScaling
A scaling algorithm that returns a constant value regardless of level.
Since:
0.1.0
  • 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: LevelScaling
      Calculates the scaled value for a given enchantment level.
      Specified by:
      calculate in interface LevelScaling
      Parameters:
      level - the enchantment level (>= 1)
      Returns:
      the calculated value
    • getValue

      public double getValue()
      Gets the constant value.
      Returns:
      the value
    • toString

      @NotNull public @NotNull String toString()
      Overrides:
      toString in class Object