Options
All
  • Public
  • Public/Protected
  • All
Menu

Wraps an EntityComponentDb to provide a statically-typed, more ORM-like interface. If you want raw access to the dynamically-typed component data, grab the EntityComponentDb

Hierarchy

  • EntityComponentStateImpl

Implements

Index

Constructors

constructor

Properties

Private classRegistry

classRegistry: any

Private componentTypes

componentTypes: any

Private deletionHidingFacade

deletionHidingFacade: any

Private entityComponentDb

entityComponentDb: any

Methods

createEntity

deleteComponent

  • deleteComponent<T>(componentType: new () => T, ownerId: EntityId): void

deleteEntity

  • deleteEntity(entityId: EntityId): void

getAspect

  • getAspect<T, U>(componentTypeT: new () => T, componentTypeU: new () => U): Iterable<[Component<T>, Component<U>]>
  • getAspect<T, U, V>(componentTypeT: new () => T, componentTypeU: new () => U, componentTypeV: new () => V): Iterable<[Component<T>, Component<U>, Component<V>]>

getAspectGeneric

getComponent

  • getComponent<T>(componentType: new () => T, ownerId: EntityId): undefined | Component<T>
  • Returns a Component of the supplied type if the given entity owns one

    Type parameters

    Parameters

    • componentType: new () => T
        • new (): T
        • Returns T

    • ownerId: EntityId

    Returns undefined | Component<T>

getComponents

  • getComponents<T>(componentType: new () => T): Iterable<Component<T>>

getEntity

getEntityComponentDb

releaseDeletedState

  • releaseDeletedState(): void

serialize

setComponent

  • Sets the component data of the given owner. If entity already has component of this type, it overwrites existing component If entity does not exist, it will return undefined.

    Type parameters

    Parameters

    Returns undefined | Component<T>

withDeletedStateHidden

Generated using TypeDoc