What problem does this solve or what need does it fill?
The ordinary approach for getting the list of entities (query for Query<Entity>) doesn't work in contexts where you only have read-only access to the World.
What solution would you like?
Add an Entities::iter() or World::iter_entities() method.
What alternative(s) have you considered?
The following snippet works
for archetype in world.archetypes().iter() {
builder.extract_entities(archetype.entities().iter().copied());
Borrowed from @mockersf in https://github.com/bevyengine/bevy/pull/6227/files#diff-717fbf581c75ed1fc65c9755af2bf8a2ddc97c02e89f4044f86efa70a2ea4260L45
Additional context
It's not entirely clear if Entities::iter() can be implemented directly without digging in; I'm not sure if we have all of the information needed there.
What problem does this solve or what need does it fill?
The ordinary approach for getting the list of entities (query for
Query<Entity>) doesn't work in contexts where you only have read-only access to theWorld.What solution would you like?
Add an
Entities::iter()orWorld::iter_entities()method.What alternative(s) have you considered?
The following snippet works
Borrowed from @mockersf in https://github.com/bevyengine/bevy/pull/6227/files#diff-717fbf581c75ed1fc65c9755af2bf8a2ddc97c02e89f4044f86efa70a2ea4260L45
Additional context
It's not entirely clear if
Entities::iter()can be implemented directly without digging in; I'm not sure if we have all of the information needed there.