Skip to content

Add OR and AND combinators for system run conditions #7584

Closed

Description

@alice-i-cecile
          > I suspected that the only way to make an OR-combinator might be using a custom System impl, and now you confirmed it. So, I think it's out of scope for this PR.

Agreed. I'd like both OR and AND combinators (to follow-up #7559), but that's out of scope here.

Originally posted by @alice-i-cecile in #7579 (comment)

Activity

  1. added
    A-ECSEntities, components, systems, and events
    C-UsabilityA targeted quality-of-life change that makes Bevy easier to use
    on Feb 9, 2023
  2. joseph-gio commented on Feb 10, 2023

    @joseph-gio
    Member

    Just to clarify the behavior of these combinators, they should short-circuit, right? A non-short-circuiting AND combinator would be fairly useless, since you could achieve the same effect by just calling .run_if() multiple times.

  3. alice-i-cecile commented on Feb 10, 2023

    @alice-i-cecile
    MemberAuthor

    Yeah, short-circuiting is essential. And should have non-surprising behavior (barring interior mutability) because run conditions are read-only.

  4. joseph-gio commented on Feb 10, 2023

    @joseph-gio
    Member

    In that case, I think it would be good to call these and_then/or_else, in order to emphasize the fact that they short circuit.

  5. added this to the 0.10 milestone on Feb 17, 2023
  6. added a commit that references this issue on Feb 20, 2023
    0c98f9a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions