Options
All
  • Public
  • Public/Protected
  • All
Menu

The entity is the container of components.

Hierarchy

  • Entity

Index

Constructors

constructor

Properties

Readonly id

id: number

unique id of entity

Accessors

componentAdded$

  • get componentAdded$(): Observable<Component>
  • Stream triggered when a component is added Note: make sure to unsubscribe. If needed, use DisposeBag util

    Returns Observable<Component>

componentRemoved$

  • get componentRemoved$(): Observable<Component>
  • Stream triggered when a component is removed Note: make sure to unsubscribe. If needed, use DisposeBag util

    Returns Observable<Component>

Methods

addComponent

getComponent

  • getComponent<T>(componentName: symbol): undefined | T
  • Get a component of this entity by name.

    Type parameters

    Parameters

    • componentName: symbol

    Returns undefined | T

hasComponent

  • hasComponent(componentName: symbol): boolean
  • Check if this entity has a component by name.

    Parameters

    • componentName: symbol

    Returns boolean

removeComponent

  • removeComponent(componentName: symbol): Entity
  • Remove a component from this entity by name.

    Parameters

    • componentName: symbol

    Returns Entity

Legend

  • Constructor
  • Property
  • Method
  • Property

Generated using TypeDoc