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

Add IntoIterator to &mut EventReader #5719

Closed
wants to merge 1 commit into from

Conversation

Aceeri
Copy link
Member

@Aceeri Aceeri commented Aug 16, 2022

Objective

  • Convenience method for a common usecase, maybe a bit controversial given the boxing but can't name the iterator directly unless we rework how it works (I could look at doing that if we want though)

Solution

@Weibye Weibye added A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Aug 18, 2022
@cart
Copy link
Member

cart commented Aug 18, 2022

Yeah I don't think the ergonomics here is "worth it". We should sort out a way to remove the box.

@Aceeri
Copy link
Member Author

Aceeri commented Aug 18, 2022

Gotcha, should definitely be possible, will mostly just be reworking the maps because of the closures, I'll modify this PR to make a more dedicated Iterator for the manual event reader.

@cart
Copy link
Member

cart commented Aug 30, 2022

Closing this as I think the Box isn't the right direction. Given that theres movement on #5735, feel free to open a new pr with a new impl when its ready!

@cart cart closed this Aug 30, 2022
bors bot pushed a commit that referenced this pull request Dec 25, 2022
# Objective
- Be able to name the type that `ManualEventReader::iter/iter_with_id` returns and `EventReader::iter/iter_with_id` by proxy.
  Currently for the purpose of #5719

## Solution
- Create a custom `Iterator` type.
bors bot pushed a commit that referenced this pull request Dec 25, 2022
# Objective
- Be able to name the type that `ManualEventReader::iter/iter_with_id` returns and `EventReader::iter/iter_with_id` by proxy.
  Currently for the purpose of #5719

## Solution
- Create a custom `Iterator` type.
bors bot pushed a commit that referenced this pull request Dec 25, 2022
# Objective
- Be able to name the type that `ManualEventReader::iter/iter_with_id` returns and `EventReader::iter/iter_with_id` by proxy.
  Currently for the purpose of #5719

## Solution
- Create a custom `Iterator` type.
alradish pushed a commit to alradish/bevy that referenced this pull request Jan 22, 2023
…gine#5735)

# Objective
- Be able to name the type that `ManualEventReader::iter/iter_with_id` returns and `EventReader::iter/iter_with_id` by proxy.
  Currently for the purpose of bevyengine#5719

## Solution
- Create a custom `Iterator` type.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
…gine#5735)

# Objective
- Be able to name the type that `ManualEventReader::iter/iter_with_id` returns and `EventReader::iter/iter_with_id` by proxy.
  Currently for the purpose of bevyengine#5719

## Solution
- Create a custom `Iterator` type.
bors bot pushed a commit that referenced this pull request Feb 17, 2023
# Objective
Continuation of #5719
Now that we have a definable type for the iterator.

---

## Changelog
- Implemented IntoIterator for EventReader so you can now do `&mut reader` instead of `reader.iter()` for events.
bors bot pushed a commit that referenced this pull request Feb 17, 2023
# Objective
Continuation of #5719
Now that we have a definable type for the iterator.

---

## Changelog
- Implemented IntoIterator for EventReader so you can now do `&mut reader` instead of `reader.iter()` for events.
myreprise1 pushed a commit to myreprise1/bevy that referenced this pull request Feb 18, 2023
# Objective
Continuation of bevyengine#5719
Now that we have a definable type for the iterator.

---

## Changelog
- Implemented IntoIterator for EventReader so you can now do `&mut reader` instead of `reader.iter()` for events.
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 targeted quality-of-life change that makes Bevy easier to use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants