Skip to content

Non-consuming method to check if events are empty #2967

@alice-i-cecile

Description

@alice-i-cecile

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-UsabilityA targeted quality-of-life change that makes Bevy easier to use

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions