-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Non-consuming method to check if events are empty #2967
Copy link
Copy link
Closed
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-UsabilityA targeted quality-of-life change that makes Bevy easier to useA targeted quality-of-life change that makes Bevy easier to use
Description
What problem does this solve or what need does it fill?
Game logic commonly branches based on the presence or absence of events.
However, the only way to read events is to consume them.
You can of course drain and then reconstitute the events, but this is terrible.
What solution would you like?
Add a peek method to events.
What alternative(s) have you considered?
Use size hints to provide a dedicated .is_empty method on events instead.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-UsabilityA targeted quality-of-life change that makes Bevy easier to useA targeted quality-of-life change that makes Bevy easier to use