Closed
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.