Skip to content

Add a Includes query filter for working with disabling components #17803

@alice-i-cecile

Description

@alice-i-cecile

IMO this should include an example of a Query that matches entities that are both enabled and disabled. The ones shown match only entities that are disabled.

Has matches both!

Ah right. It still feels kinda hacky though.

Originally posted by @SkiFire13 in #17768 (comment)

When working with default query filters, it's reasonably common to want to be agnostic to the presence of a given disabling component.

Currently, users can stick a Has or Option query data term in there, and get the desired behavior, but they often don't want the information contained in that term.

We should provide them with a query filter equivalent, which I think should be called Includes<C>. This filter would be absolutely useless for normal components, as it includes entities with or without C. But if we set the access up correctly, this should trick DQF into showing us the entities we want, regardless of whether or not they have C.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions