Query <TKnownComponentCtors>
Index
Constructors
constructor
Type parameters
- TKnownComponentCtors: ComponentCtor<Component> = never
Parameters
requiredComponents: TKnownComponentCtors[]
Returns Query<TKnownComponentCtors>
Properties
publiccomponents
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
publicreadonlyid
publicreadonlyrequiredComponents
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 Entity<ComponentInstance<TKnownComponentCtors>>[]
removeEntity
Parameters
entity: Entity<any>
Returns void
staticcreateId
Parameters
requiredComponents: Function[]
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