Class DamageFunction

    • Field Detail

      • ZERO_DAMAGE

        public static final java.util.function.DoubleUnaryOperator ZERO_DAMAGE
    • Constructor Detail

      • DamageFunction

        public DamageFunction​(DamageModifier modifier,
                              java.util.function.DoubleUnaryOperator function)
        Creates a new DamageFunction with the provided DamageModifier and DoubleUnaryOperator.
        Parameters:
        modifier - The modifier
        function - The function
    • Method Detail

      • of

        public static DamageFunction of​(DamageModifier first,
                                        java.util.function.DoubleUnaryOperator second)
        Constructs a new damage function.
        Parameters:
        first - The damage modifier to use
        second - The unary operator to use
        Returns:
        The resulting damage function
      • function

        public java.util.function.DoubleUnaryOperator function()
        Gets the DoubleUnaryOperator for this function.
        Specified by:
        function in interface ModifierFunction<DamageModifier>
        Returns:
        The damage function
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(@Nullable java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object