Skip to main content

EntityManager

Index

Constructors

constructor

Properties

public_entityIndex

_entityIndex: {} = {}

Type declaration

publicentities

entities: Entity<any>[] = []

Methods

publicaddEntity

  • addEntity(entity: Entity<any>): void
  • Adds an entity to be tracked by the EntityManager


    Parameters

    Returns void

publicclear

  • clear(): void
  • Returns void

publicfindEntitiesForRemoval

  • findEntitiesForRemoval(): void
  • Returns void

publicgetById

  • getById(id: number): Entity<any>
  • Parameters

    • id: number

    Returns Entity<any>

publicgetByName

  • getByName(name: string): Entity<any>[]
  • Parameters

    • name: string

    Returns Entity<any>[]

publicprocessComponentRemovals

  • processComponentRemovals(): void
  • Returns void

publicprocessEntityRemovals

  • processEntityRemovals(): void
  • Returns void

publicremoveEntity

  • removeEntity(entity: Entity<any>, deferred?: boolean): void
  • removeEntity(id: number, deferred?: boolean): void
  • Parameters

    • entity: Entity<any>
    • optionaldeferred: boolean

    Returns void

publicupdateEntities

  • updateEntities(scene: Scene<unknown>, elapsed: number): void
  • Runs the entity lifecycle


    Parameters

    • scene: Scene<unknown>
    • elapsed: number

    Returns void