omega-game-engine
    Preparing search index...

    Class NumberRange

    Represents a numeric value constrained within a defined range. It provides mechanisms for clamping the value and ensuring bounds integrity.

    Hierarchy (View Summary)

    Indexable

    • [key: string]: any
    Index

    Constructors

    • Creates an instance of NumberRange.

      Parameters

      • _value: number

        The initial value.

      • Optional_min: number = 0

        The minimum bound.

      • Optional_max: number = 0

        The maximum bound.

      • Optional_step: number = 0

        The increment step.

      Returns NumberRange

    Properties

    _className: string
    _max: number = 0

    The maximum bound.

    _min: number = 0

    The minimum bound.

    _serializationIgnoreKeys: string[]
    _step: number = 0

    The increment step.

    _uuid: string
    _value: number

    The initial value.

    name: string = ''

    Accessors

    • get max(): number

      Gets the maximum bound.

      Returns number

    • set max(max: number): void

      Sets the maximum bound. If it is less than the minimum, min is adjusted to match max. Re-clamps the current value.

      Parameters

      • max: number

        The new maximum.

      Returns void

    • get min(): number

      Gets the minimum bound.

      Returns number

    • set min(min: number): void

      Sets the minimum bound. If it exceeds the maximum, max is adjusted to match min. Re-clamps the current value.

      Parameters

      • min: number

        The new minimum.

      Returns void

    • get step(): number

      Gets the increment step.

      Returns number

    • set step(step: number): void

      Sets the increment step.

      Parameters

      • step: number

        The new step.

      Returns void

    • get value(): number

      Gets the current value.

      Returns number

    • set value(value: number): void

      Sets the current value, clamping it between min and max.

      Parameters

      • value: number

        The new value.

      Returns void

    Methods

    • Deserializes the range's state from a JSON object.

      Parameters

      • jsonObject: any

        The JSON object to deserialize from.

      Returns void