Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OR and AND combinators for system run conditions #7584

Closed
alice-i-cecile opened this issue Feb 9, 2023 · 3 comments
Closed

Add OR and AND combinators for system run conditions #7584

alice-i-cecile opened this issue Feb 9, 2023 · 3 comments
Labels
A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use
Milestone

Comments

@alice-i-cecile
Copy link
Member

          > 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)

@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Feb 9, 2023
@JoJoJet
Copy link
Member

JoJoJet commented Feb 10, 2023

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.

@alice-i-cecile
Copy link
Member Author

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

@JoJoJet
Copy link
Member

JoJoJet commented Feb 10, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants