You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to what bevy does, the ability to query for entities that have some components but not others could be quite useful in the ECS api. (Without<Component>)
The same goes with knowing if any component attached to an entity has Changed. (Changed<Component>)
The text was updated successfully, but these errors were encountered:
Exiled1
changed the title
Add Change<T> and Without<T> to Query
Add Changed<T> and Without<T> to Query
Mar 21, 2023
Thinking about the interface for this, maybe it could be like:
Query::new().intersect::<Transform>().exclude::<SomeComponent>()// Filters for entities without SomeComponent.changed()// Applies to the entire entity; if ANY component changed then the entity is included in the query result
We don't need union() because having multiple queries covers this use-case. Technically, we don't need exclude() either, since you could use two queries and the planned has_component() interface to acheive the same results - but it's less efficient and less ergonomic so I think we should still add exclude().
Note that the behavior for exclude() would be that it only applies to entities which have been included by other terms; I.e. Query::new().exclude::<AnyComponentHere>() would always return an empty query result because there is no .intersect().
Similar to what bevy does, the ability to query for entities that have some components but not others could be quite useful in the ECS api. (Without<Component>)
The same goes with knowing if any component attached to an entity has Changed. (Changed<Component>)
The text was updated successfully, but these errors were encountered: