Hi all, I am fairly new to Bevy and the ECS concept. The challenge I am thinking about now is the efficiency querying components that belong to a bundle. As an example, say I have a "CityBundle" that looks like this:
pub struct CityBundle {
_c: City,
pub name: CityName,
pub demographics: Demographics,
pub resources: Resources,
...
}
I have systems that run on the Demographics and Resources components for simulation. However, if I want to create a pop-up window with information about this city, I find myself writing queries of the like:
selection_query: Query<(&CityName, &Demographics, &Resources, &mut Selection), With<City>>
which I can pass to a GUI to display information. However, this feels pretty inefficient especially as what constitutes a CityBundle gets more complex. Is there a better way that I don't know about to avoid complex queries such as these? I am trying to keep the components as simple as possible, but this feels like it comes at the cost of complex queries if I want a bunch of them.