Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BaseObject

Hierarchy

Index

Constructors

Protected constructor

  • Returns BaseObject

Properties

Readonly id

id: number

Readonly refCount

refCount: number

Returns the ref count of the entity.

remarks

It's only available in debug-mode.

Readonly type

Type of the object.

Readonly valid

valid: boolean

Object usability.

returns

False if object is no longer usable.

Methods

deleteMeta

  • deleteMeta(key: string): void
  • deleteMeta<K>(key: K): void
  • Removes the specified key and the data connected to that specific key.

    Parameters

    • key: string

      The key of the value to remove.

    Returns void

  • Type parameters

    Parameters

    • key: K

    Returns void

destroy

  • destroy(): void
  • Removes the object from the world.

    Returns void

getMeta

  • getMeta<K>(key: Exclude<K, keyof ICustomBaseObjectMeta>): unknown
  • getMeta<K>(key: K): ICustomBaseObjectMeta[K] | undefined
  • getMeta<V>(key: string): V | undefined
  • Gets a value using the specified key.

    Type parameters

    • K: string

    Parameters

    Returns unknown

    Dynamic value associated with the specified key or undefined if no data is present.

  • Type parameters

    Parameters

    • key: K

    Returns ICustomBaseObjectMeta[K] | undefined

  • deprecated

    See ICustomBaseObjectMeta

    Type parameters

    • V: any

    Parameters

    • key: string

    Returns V | undefined

getMetaDataKeys

  • getMetaDataKeys(): readonly string[]
  • Returns readonly string[]

getSyncedMeta

  • getSyncedMeta<K>(key: Exclude<K, keyof ICustomBaseObjectSyncedMeta>): unknown
  • getSyncedMeta<K>(key: K): ICustomBaseObjectSyncedMeta[K] | undefined
  • getSyncedMeta<V>(key: string): V | undefined
  • Gets a value using the specified key.

    Type parameters

    • K: string

    Parameters

    Returns unknown

    Dynamic value associated with the specified key or undefined if no data is present.

  • Type parameters

    Parameters

    • key: K

    Returns ICustomBaseObjectSyncedMeta[K] | undefined

  • Type parameters

    • V: any

    Parameters

    • key: string

    Returns V | undefined

getSyncedMetaKeys

  • getSyncedMetaKeys(): readonly string[]
  • Returns readonly string[]

hasMeta

  • hasMeta(key: string): boolean
  • hasMeta<K>(key: K): boolean
  • Determines whether contains the specified key.

    Parameters

    • key: string

      The key of the value to locate.

    Returns boolean

    True when element associated with the specified key is stored.

  • Type parameters

    Parameters

    • key: K

    Returns boolean

hasSyncedMeta

  • hasSyncedMeta(key: string): boolean
  • hasSyncedMeta<K>(key: K): boolean
  • Determines whether contains the specified key.

    Parameters

    • key: string

      The key of the value to locate.

    Returns boolean

    True if the meta table contains any data at the specified key or False if not

  • Type parameters

    Parameters

    • key: K

    Returns boolean

setMeta

  • setMeta<K>(key: K, value: InterfaceValueByKey<ICustomBaseObjectMeta, K>): void
  • setMeta<K>(key: K, value: ICustomBaseObjectMeta[K]): void
  • setMeta<V, K>(key: K, value: InterfaceValueByKey<ICustomBaseObjectMeta, K, V>): void
  • Stores the given value with the specified key.

    remarks

    The given value will be shared locally.

    Type parameters

    • K: string

    Parameters

    • key: K

      The key of the value to store.

    • value: InterfaceValueByKey<ICustomBaseObjectMeta, K>

      The value to store.

    Returns void

  • Type parameters

    Parameters

    • key: K
    • value: ICustomBaseObjectMeta[K]

    Returns void

  • deprecated

    See ICustomBaseObjectMeta

    Type parameters

    • V: any

    • K: string = string

    Parameters

    Returns void