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 EventWriter #1575

Closed

Conversation

TheRawMeatball
Copy link
Member

@TheRawMeatball TheRawMeatball commented Mar 6, 2021

This adds a EventWriter<T> SystemParam that is just a thin wrapper around ResMut<Events<T>>. This is primarily to have API symmetry between the reader and writer, and has the added benefit of easily improving the API later with no breaking changes.

@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Mar 6, 2021
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super straightforward and much easier to reason about as an end user. I like the split between send and send_batch; it's a nice hook to optimize for later.

@alice-i-cecile alice-i-cecile 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 Mar 6, 2021
@cart
Copy link
Member

cart commented Mar 7, 2021

Yeah I think parity here is a good call.

@cart
Copy link
Member

cart commented Mar 7, 2021

bors r+

bors bot pushed a commit that referenced this pull request Mar 7, 2021
This adds a `EventWriter<T>` `SystemParam` that is just a thin wrapper around `ResMut<Events<T>>`. This is primarily to have API symmetry between the reader and writer, and has the added benefit of easily improving the API later with no breaking changes.
@bors
Copy link
Contributor

bors bot commented Mar 7, 2021

@bors bors bot changed the title Add EventWriter [Merged by Bors] - Add EventWriter Mar 7, 2021
@bors bors bot closed this Mar 7, 2021
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 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