Options
All
  • Public
  • Public/Protected
  • All
Menu

An entity is a lightweight reference to a set of components. Entities are one of the foundations of the Entity Component System architecture, and are used in almost all operations. For operations that involve an entity, see ut.World.

Hierarchy

Index

Constructors

constructor

  • new Entity(index?: number, version?: number): Entity
  • Parameters

    • Optional index: number
    • Optional version: number

    Returns Entity

Properties

index

index: number

The index into the entities array. A world cannot have two entities with the same index at the same time. The NONE entity has index=0 and version=0.

You should not need to access the index directly except in specific cases such as making by-value copies of entities, or inspection during debugging.

Note that entity index is re-used. This means that once an Entity with a specific index is destroyed, its index might be returned for a newly created entity. However, the combination of index + version is always unique.

version

version: number

The version of this entity reference. The NONE entity has version=0 and index=0. You should not need to access the index directly except in specific cases such as inspection during debugging. Not that the combination of version + index is always unique.

Static _isSharedComp

_isSharedComp: boolean

Static _size

_size: number

Static _view

_view: any

Static cid

cid: number

Static index

Static version

Methods

isNone

  • isNone(): boolean
  • Check if this entity is NONE.

    Returns boolean

    True if the entity is NONE, false otherwise.

Static _dtorFn

  • Parameters

    Returns void

Static _fromPtr

  • Parameters

    • p: number
    • Optional v: Entity

    Returns Entity

Static _tempHeapPtr

  • _tempHeapPtr(v: Entity): number
  • Parameters

    Returns number

Static _toPtr

  • _toPtr(p: number, v: Entity): void
  • Parameters

    Returns void

Generated using TypeDoc