Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EntityManager

Hierarchy

Index

Constructors

constructor

Methods

attachDynamicComponent

  • attachDynamicComponent(entity: any, component: any): void
  • Call to attach a new component after the creation of the entity

    Parameters

    • entity: any
    • component: any

    Returns void

deserialize

  • deserialize(data: any): any

destroyEntity

  • destroyEntity(entity: any): void
  • Queues an entity for destruction

    Parameters

    • entity: any

    Returns void

findByUid

  • findByUid(uid: any, errorWhenNotFound?: boolean): any
  • Finds an entity buy its uid, kinda slow since it loops over all entities

    Parameters

    • uid: any
    • Default value errorWhenNotFound: boolean = true

    Returns any

generateUid

  • generateUid(): any
  • Generates a new uid

    Returns any

getAllOfClass

  • getAllOfClass(entityClass: any): any[]
  • Return all of a given class. This is SLOW!

    Parameters

    • entityClass: any

    Returns any[]

    entities

getAllOfClassOfFaction

  • getAllOfClassOfFaction(entityClass: any, faction: any): any[]
  • Return all of a given class. This is SLOW!

    Parameters

    • entityClass: any
    • faction: any

    Returns any[]

    entities

getAllWithComponent

  • getAllWithComponent(componentHandle: any): any
  • Returns all entities having the given component

    Parameters

    • componentHandle: any

    Returns any

    entities

getAllWithComponentOfAllied

  • getAllWithComponentOfAllied(componentHandle: any, faction: any): any[]
  • Returns all entities having the given component of an alliad faction of the given faction. This is SLOW!

    Parameters

    • componentHandle: any
    • faction: any

    Returns any[]

    entities

getAllWithComponentOfFaction

  • getAllWithComponentOfFaction(componentHandle: any, faction: any): any[]
  • Returns all entities having the given component of the given faction. This is SLOW!

    Parameters

    • componentHandle: any
    • faction: any

    Returns any[]

    entities

getStatsText

  • getStatsText(): string
  • Returns string

processDestroyList

  • processDestroyList(): void
  • Returns void

registerEntity

  • registerEntity(entity: any, uid?: any): void
  • Registers a new entity

    Parameters

    • entity: any
    • Default value uid: any = null

      Optional predefined uid

    Returns void

serialize

  • serialize(): object

unregisterEntityComponents

  • unregisterEntityComponents(entity: any): void
  • Unregisters all components of an entity from the component to entity mapping

    Parameters

    • entity: any

    Returns void

update

  • update(): void
  • Returns void

Static getCachedSchema

  • getCachedSchema(): any

Static getId

  • getId(): string

Static getSchema

  • getSchema(): object

Static verify

  • verify(data: any): string