Skip to content

Conversation

@geieredgar
Copy link
Contributor

Objective

Solution

  • This PR extracted the distributive_run_if part of run_if for SystemConfigs via anonymous system sets #7676, because it does not require the controversial introduction of anonymous system sets.
  • The distinctive name should make the user aware about the differences between IntoSystemConfig::run_if and IntoSystemConfigs::distributive_run_if.
  • The documentation explains in detail the consequences of using the API and possible pit falls when using it.
  • A test demonstrates the possibility of changing the condition result, resulting in some of the systems not being run.

Changelog

Added

  • Add distributive_run_if to IntoSystemConfigs to enable adding a run condition to each system when using add_systems.

Copy link
Member

@joseph-gio joseph-gio left a comment

Choose a reason for hiding this comment

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

Good change, this should be uncontroversial.

This needs to be included in one of our examples, but it doesn't have to be done in this PR.

@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 17, 2023
@alice-i-cecile alice-i-cecile added this to the 0.10 milestone Feb 17, 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.

Nice to pull this out. Agreed: I think we have consensus on this bit.

@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Feb 17, 2023
@cart
Copy link
Member

cart commented Feb 18, 2023

bors r+

bors bot pushed a commit that referenced this pull request Feb 18, 2023
# Objective

- Fixes #7659.

## Solution

- This PR extracted the `distributive_run_if` part of #7676, because it does not require the controversial introduction of anonymous system sets.
- The distinctive name should make the user aware about the differences between `IntoSystemConfig::run_if` and `IntoSystemConfigs::distributive_run_if`.
- The documentation explains in detail the consequences of using the API and possible pit falls when using it.
- A test demonstrates the possibility of changing the condition result, resulting in some of the systems not being run.

---

## Changelog

### Added
- Add `distributive_run_if` to `IntoSystemConfigs` to enable adding a run condition to each system when using `add_systems`.
@bors bors bot changed the title Add distributive_run_if to IntoSystemConfigs [Merged by Bors] - Add distributive_run_if to IntoSystemConfigs Feb 18, 2023
@bors bors bot closed this Feb 18, 2023
myreprise1 pushed a commit to myreprise1/bevy that referenced this pull request Feb 20, 2023
# Objective

- Fixes bevyengine#7659.

## Solution

- This PR extracted the `distributive_run_if` part of bevyengine#7676, because it does not require the controversial introduction of anonymous system sets.
- The distinctive name should make the user aware about the differences between `IntoSystemConfig::run_if` and `IntoSystemConfigs::distributive_run_if`.
- The documentation explains in detail the consequences of using the API and possible pit falls when using it.
- A test demonstrates the possibility of changing the condition result, resulting in some of the systems not being run.

---

## Changelog

### Added
- Add `distributive_run_if` to `IntoSystemConfigs` to enable adding a run condition to each system when using `add_systems`.
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 S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support run_if for SystemConfigs

4 participants