forked from bevyengine/bevy
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow iterating over with EntityRef over the entire World (bevyengine…
…#6843) # Objective Partially addresses bevyengine#5504. Allow users to get an `Iterator<Item = EntityRef<'a>>` over all entities in the `World`. ## Solution Change `World::iter_entities` to return an iterator of `EntityRef` instead of `Entity`. Not sure how to tackle making an `Iterator<Item = EntityMut<'_>>` without being horribly unsound. Might need to wait for `LendingIterator` to stabilize so we can ensure only one of them is valid at a given time. --- ## Changelog Changed: `World::iter_entities` now returns an iterator of `EntityRef` instead of `Entity`.
- Loading branch information
Showing
2 changed files
with
17 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters