Class GameAttribute<EnableBoost>

Represents a game attribute. Attribute is the data class and AttributeStatic is the static class where all the useful functions are. To use, destruct the data and static properties from the class.

Type Parameters

  • EnableBoost extends boolean = true

    Indicates whether the boost is enabled. Defaults to true.

Hierarchy (view full)

Constructors

Properties

Accessors

Methods

Constructors

Properties

boost: EnableBoost extends true
    ? Boost
    : null

The boost of the attribute. NOTE: This will not be used if the boost is disabled.

game?: Game

The game pointer/reference

initial: Decimal

The initial value of the attribute.

pointerFn: (() => Attribute)

The data for the attribute.

Accessors

  • get static(): this
  • Returns this

    The static data for the attribute.

    Use this class as a static. This property is only here for backwards compatibility.

  • get value(): Decimal
  • Gets the value of the attribute, and also updates the value stored. NOTE: This getter must be called every time the boost is updated, else the value stored will not be updated.

    Returns Decimal

    The calculated value of the attribute.

  • set value(value): void
  • Sets the value of the attribute. NOTE: This setter should not be used when boost is enabled.

    Parameters

    • value: Decimal

      The value to set the attribute to.

    Returns void

Methods

  • Updates the value of the attribute. NOTE: This method must be called every time the boost is updated, else the value stored will not be updated.

    Returns void

    This is automatically called when the value is accessed. It will be removed in the future.