-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-DocsAn addition or correction to our documentationAn addition or correction to our documentation
Description
What problem does this solve or what need does it fill?
The most simple of systems require a lot of ugly boiler plate code such as:
- a for loop
- destructing operations
- hard to read queries
- hard to debug
What solution would you like?
#[derive(Query)]
pub struct PointMassQuery{
position: &mut Position,
momentum: &Momentum,
mass: &Mass
}
pub fn newtons_first_law(point_mass: PointMassQuerry, time: Res<Time>) {
point_mass.position += time.delta_seconds() * point_mass.momentum / point_mass.mass;
}
fn system_with_queryable(q: Query<PointMassQuery>) {}What alternative(s) have you considered?
#2252 but that requires all param to be mutable to be useful. it is possible to make a macro to generate an all inclusive named query for early development to address this use case.
The old school for-each sytanx but that is not very flexible
Additional context
Figuring this out will make the relation system way cleaner and more usable.
Nilirad and Zoxive
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-DocsAn addition or correction to our documentationAn addition or correction to our documentation