[Merged by Bors] - Add iter_entities to World #6228#6242
[Merged by Bors] - Add iter_entities to World #6228#6242ramirezmike wants to merge 2 commits intobevyengine:mainfrom
Conversation
alice-i-cecile
left a comment
There was a problem hiding this comment.
Nice and thorough tests :) Once the doc nits and the .copied changes are made I'll be happy to approve this.
|
@ramirezmike once you've made the appropriate changes feel free to resolve the comments :) |
|
Could you use this new function in the scene code from #6227? |
|
Yep, it would be ideal to clean that code up while we're here. If you don't have time, I'll merge this on Monday and make a new easy. |
I rebased and added a commit to update dynamic_scene.rs to use iter_entities. I know the code is pretty much the same and all the tests pass, but I'll admit, I'm not too familiar with the behavior of dynamic_scene. I ran the scene/scene example before and after the changes and compared the output and it was the same. Let me know if you'd like me to do more extensive testing though 👍 |
alice-i-cecile
left a comment
There was a problem hiding this comment.
That refactor looks great; that's exactly what I was hoping to see.
|
bors r+ |
# Objective - Add a way to iterate over all entities from &World ## Solution - Added a function `iter_entities` on World which returns an iterator of `Entity` derived from the entities in the `World`'s `archetypes` --- ## Changelog - Added a function `iter_entities` on World, allowing iterating over all entities in contexts where you only have read-only access to the World.
|
Pull request successfully merged into main. Build succeeded: |
# Objective - Add a way to iterate over all entities from &World ## Solution - Added a function `iter_entities` on World which returns an iterator of `Entity` derived from the entities in the `World`'s `archetypes` --- ## Changelog - Added a function `iter_entities` on World, allowing iterating over all entities in contexts where you only have read-only access to the World.
# Objective - Add a way to iterate over all entities from &World ## Solution - Added a function `iter_entities` on World which returns an iterator of `Entity` derived from the entities in the `World`'s `archetypes` --- ## Changelog - Added a function `iter_entities` on World, allowing iterating over all entities in contexts where you only have read-only access to the World.
# Objective - Add a way to iterate over all entities from &World ## Solution - Added a function `iter_entities` on World which returns an iterator of `Entity` derived from the entities in the `World`'s `archetypes` --- ## Changelog - Added a function `iter_entities` on World, allowing iterating over all entities in contexts where you only have read-only access to the World.
# Objective - Add a way to iterate over all entities from &World ## Solution - Added a function `iter_entities` on World which returns an iterator of `Entity` derived from the entities in the `World`'s `archetypes` --- ## Changelog - Added a function `iter_entities` on World, allowing iterating over all entities in contexts where you only have read-only access to the World.
Objective
Solution
iter_entitieson World which returns an iterator ofEntityderived from the entities in theWorld'sarchetypesChangelog
iter_entitieson World, allowing iterating over all entities in contexts where you only have read-only access to the World.