Skip to main content

QueryManager

The query manager is responsible for updating all queries when entities/components change

Index

Constructors

constructor

Methods

addComponent

  • Updates any queries when a component is added to an entity


    Parameters

    Returns void

addEntity

  • addEntity(entity: Entity<any>): void
  • Scans queries and locates any that need this entity added


    Parameters

    Returns void

addTag

  • addTag(entity: Entity<any>, tag: string): void
  • Updates any queries when a tag is added to an entity


    Parameters

    • entity: Entity<any>
    • tag: string

    Returns void

publiccreateQuery

  • createQuery<TKnownComponentCtors>(requiredComponents: TKnownComponentCtors[]): Query<TKnownComponentCtors>
  • Type parameters

    Parameters

    • requiredComponents: TKnownComponentCtors[]

    Returns Query<TKnownComponentCtors>

publiccreateTagQuery

  • createTagQuery<TKnownTags>(requiredTags: TKnownTags[]): TagQuery<TKnownTags>
  • Type parameters

    • TKnownTags: string

    Parameters

    • requiredTags: TKnownTags[]

    Returns TagQuery<TKnownTags>

removeComponent

  • Updates any queries when a component is removed from an entity


    Parameters

    Returns void

removeEntity

  • removeEntity(entity: Entity<any>): void
  • Scans queries and locates any that need this entity removed


    Parameters

    Returns void

removeTag

  • removeTag(entity: Entity<any>, tag: string): void
  • Updates any queries when a component is removed from an entity


    Parameters

    • entity: Entity<any>
    • tag: string

    Returns void