Query <TAllComponentCtors, TAnyComponentCtors>
Index
Constructors
constructor
Type parameters
- TAllComponentCtors: ComponentCtor<Component> = never
- TAnyComponentCtors: ComponentCtor<Component> = never
Parameters
params: TAllComponentCtors[] | QueryParams<TAllComponentCtors, TAnyComponentCtors>
Returns Query<TAllComponentCtors, TAnyComponentCtors>
Properties
publicentities
publicentityAdded$
This fires right after the component is added
publicentityRemoved$
This fires right before the component is actually removed from the entity, it will still be available for cleanup purposes
publicreadonlyfilter
Type declaration
components: { all: Set<TAllComponentCtors>; any: Set<TAnyComponentCtors>; not: Set<ComponentCtor<Component>> }
all: Set<TAllComponentCtors>
any: Set<TAnyComponentCtors>
not: Set<ComponentCtor<Component>>
tags: { all: Set<string>; any: Set<string>; not: Set<string> }
all: Set<string>
any: Set<string>
not: Set<string>
publicreadonlyid
Methods
checkAndAdd
Potentially adds an entity to a query index, returns true if added, false if not
Parameters
entity: Entity<any>
Returns boolean
publicgetEntities
Returns a list of entities that match the query
Parameters
optionalsort: (a: Entity<any>, b: Entity<any>) => number
Optional sorting function to sort entities returned from the query
Returns QueryEntity<TAllComponentCtors, TAnyComponentCtors>[]
matches
Parameters
entity: Entity<any>
Returns boolean
removeEntity
Parameters
entity: Entity<any>
Returns void
staticcreateId
Parameters
params: Function[] | QueryParams<any, any>
Returns string
statichashComponents
Parameters
set: Set<ComponentCtor<Component>>
Returns string
statichashTags
Parameters
set: Set<string>
Returns string
Represents query for entities that match a list of types that is cached and observable
Queries can be strongly typed by supplying a type union in the optional type parameter