Edit

Share via


EntityAttributeComponent Class

Extends

Classes that extend EntityAttributeComponent

This is a base abstract class for any entity component that centers around a number and can have a minimum, maximum, and default defined value.

Properties

currentValue

read-only currentValue: number;

Current value of this attribute for this instance.

Type: number

Notes:

  • This property can throw errors when used.

defaultValue

read-only defaultValue: number;

Returns the default defined value for this attribute.

Type: number

Notes:

  • This property can throw errors when used.

effectiveMax

read-only effectiveMax: number;

Returns the effective max of this attribute given any other ambient components or factors.

Type: number

Notes:

  • This property can throw errors when used.

effectiveMin

read-only effectiveMin: number;

Returns the effective min of this attribute given any other ambient components or factors.

Type: number

Notes:

  • This property can throw errors when used.

Methods

resetToDefaultValue

resetToDefaultValue(): void

Resets the current value of this attribute to the defined default value.

Notes:

  • This function can't be called in read-only mode.
  • This function can throw errors.

resetToMaxValue

resetToMaxValue(): void

Resets the current value of this attribute to the maximum defined value.

Notes:

  • This function can't be called in read-only mode.
  • This function can throw errors.

resetToMinValue

resetToMinValue(): void

Resets the current value of this attribute to the minimum defined value.

Notes:

  • This function can't be called in read-only mode.
  • This function can throw errors.

setCurrentValue

setCurrentValue(value: number): boolean

Sets the current value of this attribute.

Parameters

  • value: number

Returns boolean

Notes: