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

Make the Condition trait generic #8721

Merged
merged 6 commits into from
May 31, 2023
Merged

Conversation

JoJoJet
Copy link
Member

@JoJoJet JoJoJet commented May 31, 2023

Objective

The Condition trait is only implemented for systems and system functions that take no input. This can make it awkward to write conditions that are intended to be used with system piping.

Solution

Add an In generic to the trait. It defaults to ().


Changelog

  • Made the Condition trait generic over system inputs.

@JoJoJet JoJoJet added A-ECS Entities, components, systems, and events C-Usability A simple quality-of-life change that makes Bevy easier to use labels May 31, 2023
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but it would be nice to have a test for this.

Copy link
Member

@james7132 james7132 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the doctest and example!

@james7132 james7132 added this pull request to the merge queue May 31, 2023
Merged via the queue into bevyengine:main with commit 233b26c May 31, 2023
@JoJoJet JoJoJet deleted the condition-input branch May 31, 2023 17:14
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 simple quality-of-life change that makes Bevy easier to use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants