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 run_if_inner public and rename to run_if_dyn #9576

Merged
merged 7 commits into from
Aug 27, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions crates/bevy_ecs/src/schedule/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ impl SystemConfigs {
}
}

pub(crate) fn run_if_inner(&mut self, condition: BoxedCondition) {
/// Adds a new condition
st0rmbtw marked this conversation as resolved.
Show resolved Hide resolved
pub fn run_if_dyn(&mut self, condition: BoxedCondition) {
match self {
SystemConfigs::SystemConfig(config) => {
config.conditions.push(condition);
Expand Down Expand Up @@ -341,7 +342,7 @@ impl IntoSystemConfigs<()> for SystemConfigs {
}

fn run_if<M>(mut self, condition: impl Condition<M>) -> SystemConfigs {
self.run_if_inner(new_condition(condition));
self.run_if_dyn(new_condition(condition));
self
}

Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_ecs/src/schedule/schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ impl ScheduleGraph {
self.configure_set(set_config);
} else {
for condition in collective_conditions {
configs[0].run_if_inner(condition);
configs[0].run_if_dyn(condition);
}
}
}
Expand Down