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

joseph-gio
Copy link
Member

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.

Verified

This commit was signed with the committer’s verified signature.
tobikris Tobias Krischer
@joseph-gio joseph-gio added A-ECS Entities, components, systems, and events C-Usability A targeted 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.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was signed with the committer’s verified signature.
tobikris Tobias Krischer
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
@joseph-gio joseph-gio 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 targeted quality-of-life change that makes Bevy easier to use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants