Skip to content

Implement SystemCondition for systems returning Result<bool, BevyError> and Result<(), BevyError> #19403

Open
@urben1680

Description

@urben1680

What problem does this solve or what need does it fill?

So far systems that return bool are the only ones that can be used as conditions. Fallible systems as conditions need to either panic or do their own error handling, they hardly can snap into the usual error handling.

What solution would you like?

Implement SystemCondition for systems returning Result<bool, BevyError>.

The exact behavior on an error must be decided on: Should it go through the error handler? Either way, only systems returning Ok(true) should cause the condition to be evaluated as met.

Systems returning Result<(), BevyError> could also be used as conditions where Ok(()) is considered as a met condition.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions