Class UUID

The UUID implements an immutable universally unique identifier. It is used to identifier different types of objects uniquely, from SceneObject to Resource.

As all TypeScript types, the UUID is an identity, not a value type. To compare two UUIDs, use the UUID.isEqual method and do not compare by identity (X == Y).

Constructors

  • Parameters

    • Optionaldata0: number
    • Optionaldata1: number
    • Optionaldata2: number
    • Optionaldata3: number

    Returns UUID

Properties

empty: UUID

A zero initialized UUID.

Accessors

  • get data0(): number
  • The data part of the UUID.

    Returns number

  • get data1(): number
  • The data part of the UUID.

    Returns number

  • get data2(): number
  • The data part of the UUID.

    Returns number

  • get data3(): number
  • The data part of the UUID.

    Returns number

Methods

  • Clones this instance and returns a new UUID with identical values.

    Returns UUID

  • Checks has the UUID been initialized to a valid value.

    Returns boolean

    True if UUID is initialized.

  • Determines if both UUIDs are equal.

    Parameters

    Returns boolean

  • Converts the UUID to a BigInt representation.

    Returns bigint

    This is useful when using the UUID in a Map as key.

  • Converts the UUID to a string representation.

    Returns string

  • Creates a new UUID from the specified BigInt value.

    Parameters

    • value: bigint

      The UUID in BigInt representation.

    Returns UUID

    A new UUID.

  • Creates a new UUID from the specified uuid string.

    Parameters

    • uuid: string

      The UUID string

    Returns UUID

    A new UUID.

  • Creates a new universally unique identifier (UUID/UID).

    Returns UUID

  • Determines if both UUIDs are equal.

    Parameters

    Returns boolean