Class AttributeValue

java.lang.Object
studio.magemonkey.fabled.manager.AttributeValue

public class AttributeValue extends Object
Represents one formula modifier for an attribute that can have conditions
  • Constructor Summary

    Constructors
    Constructor
    Description
    Loads the attribute value that starts with the formula and can have as many conditions as desired after
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    apply(double value, int amount)
    Checks the conditions for the given component
    boolean
    Checks whether the formula should be applied to the component

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AttributeValue

      public AttributeValue(String data)
      Loads the attribute value that starts with the formula and can have as many conditions as desired after
      Parameters:
      data - data string for the value
  • Method Details

    • passes

      public boolean passes(EffectComponent component)
      Checks whether the formula should be applied to the component
      Parameters:
      component - component to check for conditions against
      Returns:
      true if passes the conditions
    • apply

      public double apply(double value, int amount)
      Checks the conditions for the given component
      Parameters:
      value - base value
      amount - amount of attribute points
      Returns:
      the modified value if the conditions passed or the base value if they failed