Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - add Resources::iter to iterate over all resource IDs #6592

Closed

Conversation

jakobhellermann
Copy link
Contributor

Objective

In bevy 0.8 you could list all resources using world.archetypes().resource().components(). As far as I can tell the resource archetype has been replaced with the Resources storage, and it would be nice if it could be used to iterate over all resource component IDs as well.

Solution

  • add fn Resources::iter(&self) -> impl Iterator<Item = (ComponentId, &ResourceData)>

@jakobhellermann jakobhellermann added C-Enhancement A new feature A-ECS Entities, components, systems, and events labels Nov 13, 2022
@alice-i-cecile alice-i-cecile added this to the 0.9.1 milestone Nov 13, 2022
@alice-i-cecile alice-i-cecile added C-Usability A simple quality-of-life change that makes Bevy easier to use and removed C-Enhancement A new feature labels Nov 13, 2022
@james7132 james7132 added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Nov 14, 2022
@cart
Copy link
Member

cart commented Nov 14, 2022

bors r+

bors bot pushed a commit that referenced this pull request Nov 14, 2022
# Objective

In bevy 0.8 you could list all resources using `world.archetypes().resource().components()`. As far as I can tell the resource archetype has been replaced with the `Resources` storage, and it would be nice if it could be used to iterate over all resource component IDs as well.

## Solution

- add `fn Resources::iter(&self) -> impl Iterator<Item = (ComponentId, &ResourceData)>`
@bors bors bot changed the title add Resources::iter to iterate over all resource IDs [Merged by Bors] - add Resources::iter to iterate over all resource IDs Nov 14, 2022
@bors bors bot closed this Nov 14, 2022
@jakobhellermann jakobhellermann deleted the resources-iter branch November 15, 2022 19:14
cart pushed a commit that referenced this pull request Nov 30, 2022
# Objective

In bevy 0.8 you could list all resources using `world.archetypes().resource().components()`. As far as I can tell the resource archetype has been replaced with the `Resources` storage, and it would be nice if it could be used to iterate over all resource component IDs as well.

## Solution

- add `fn Resources::iter(&self) -> impl Iterator<Item = (ComponentId, &ResourceData)>`
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
# Objective

In bevy 0.8 you could list all resources using `world.archetypes().resource().components()`. As far as I can tell the resource archetype has been replaced with the `Resources` storage, and it would be nice if it could be used to iterate over all resource component IDs as well.

## Solution

- add `fn Resources::iter(&self) -> impl Iterator<Item = (ComponentId, &ResourceData)>`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Usability A simple quality-of-life change that makes Bevy easier to use S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants