Represents an individual boost object.

Implements

Constructors

Properties

Accessors

Constructors

Properties

descriptionFn: ((...args: any[]) => string)
id: string

The ID of the boost.

name: string

The name of the boost.

order: number

The order at which the boost is applied. Lower orders are applied first.

value: ((input: Decimal) => Decimal)

The function that calculates the value of the boost.

Type declaration

// A boost that adds 10 to the input value.
(input) => input.add(10)

// A boost that multiplies the input value by 2.
(input) => input.mul(2)

Accessors

  • get description(): string
  • An optional description of the boost. Can be a string or a function that returns a string. Made into a getter function to allow for dynamic descriptions.

    Returns string

    // A dynamic description that returns a string
    const description = (a, b) => `This is a ${a} that returns a ${b}`;
    // ... create boost
    const boost = boost.getBoost("boostID");

    // Getter property
    console.log(boost.description); // "This is a undefined that returns a undefined"

    // Getter function
    console.log(boost.descriptionFn("dynamic", "string")); // "This is a dynamic that returns a string"