Constructs a new instance of the Attribute class.
Optional
pointer: Pointer<Attribute>A function or an instance of the attribute class. Defaults to a new instance of the attribute class.
Indicates whether to use boost for the attribute. Defaults to true. (hint: if you don't use boost, don't use this class and use Decimal directly)
The initial value of the attribute. Defaults to 0.
Readonly
boostThe boost of the attribute. NOTE: This will not be used if the boost is disabled.
Readonly
initialThe initial value of the attribute.
Protected
Readonly
pointerThe data for the attribute.
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.
The calculated value of the attribute.
Sets the value of the attribute. NOTE: This setter should not be used when boost is enabled.
The value to set the attribute to.
Represents a static attribute, which is number that can affected by boosts.
Note: This class is essentially a wrapper around Boost, and if you choose not to use boosts, you can use Decimal directly. It may be marked as deprecated in the future.
Example