Skip to content

Add an all purpose run condition inversion tool #7202

Closed

Description

@alice-i-cecile
          If someone run something on `resource_exists` they may also need to run something on `unless_resource_exists`.

General inversion method would be better, of course.

Originally posted by @Shatur in #6587 (comment)

This can optionally be combined with other logical combinators, like OR, XOR and AND.

Activity

  1. moved this to PR needed in Schedulingon Jan 15, 2023
  2. added
    C-UsabilityA targeted quality-of-life change that makes Bevy easier to use
    on Jan 15, 2023
  3. moved this from PR needed to Tangentially Related in Schedulingon Feb 6, 2023
  4. Shatur commented on Feb 6, 2023

    @Shatur
    Contributor

    Since we have run_if maybe we could have run_if_not?

  5. alice-i-cecile commented on Feb 6, 2023

    @alice-i-cecile
    MemberAuthor

    Hmm. I don't mind it, but I think my ideal would be to have something that can be used to mutate arbitrary Condition types, so then you can combine it with e.g. Or or And later.

  6. Shatur commented on Feb 6, 2023

    @Shatur
    Contributor

    I think my ideal would be to have something that can be used to mutate arbitrary Condition types

    I like it! So we could implement traits like Not on Conditions?

  7. alice-i-cecile commented on Feb 6, 2023

    @alice-i-cecile
    MemberAuthor

    Yep, ideally :) Unsure exactly how that would work here, but maybe !(my_condition.into) would work?

  8. alice-i-cecile commented on Feb 6, 2023

    @alice-i-cecile
    MemberAuthor

    Actually, I bet you could impl Not for T where T impl Into<Condition>.

  9. moved this from Tangentially Related to Will Be Resolved Or Obsoleted in Schedulingon Feb 8, 2023
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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions