bevy/crates/bevy_ecs/src/schedule
st0rmbtw 9d804a231e
Make run_if_inner public and rename to run_if_dyn (#9576)
# Objective

Sometimes you want to create a plugin with a custom run condition. In a
function, you take the `Condition` trait and then make a
`BoxedCondition` from it to store it. And then you want to add that
condition to a system, but you can't, because there is only the `run_if`
function available which takes `impl Condition<M>` instead of
`BoxedCondition`. So you have to create a wrapper type for the
`BoxedCondition` and implement the `System` and `ReadOnlySystem` traits
for the wrapper (Like it's done in the picture below). It's very
inconvenient and boilerplate. But there is an easy solution for that:
make the `run_if_inner` system that takes a `BoxedCondition` public.
Also, it makes sense to make `in_set_inner` function public as well with
the same motivation.


![image](https://github.com/bevyengine/bevy/assets/61053971/a4455180-7e0c-4c2b-9372-cd8b4a9e682e)
A chunk of the source code of the `bevy-inspector-egui` crate.

## Solution

Make `run_if_inner` function public.
Rename `run_if_inner` to `run_if_dyn`.

Make `in_set_inner` function public.
Rename `in_set_inner` to `in_set_dyn`.

## Changelog

Changed visibility of `run_if_inner` from `pub(crate)` to `pub`.
Renamed `run_if_inner` to `run_if_dyn`.

Changed visibility of `in_set_inner` from `pub(crate)` to `pub`.
Renamed `in_set_inner` to `in_set_dyn`.

## Migration Guide

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: Joseph <21144246+JoJoJet@users.noreply.github.com>
2023-08-27 17:53:37 +00:00
..
executor Adding Copy, Clone, Debug to derived traits of ExecutorKind (#9385) 2023-08-11 21:45:32 +00:00
condition.rs Fix typos throughout the project (#9090) 2023-07-10 00:11:51 +00:00
config.rs Make run_if_inner public and rename to run_if_dyn (#9576) 2023-08-27 17:53:37 +00:00
graph_utils.rs Remove reference to base sets (#9032) 2023-07-03 20:44:10 +00:00
mod.rs Fix typos throughout the project (#9090) 2023-07-10 00:11:51 +00:00
schedule.rs Make run_if_inner public and rename to run_if_dyn (#9576) 2023-08-27 17:53:37 +00:00
set.rs Fix CI for Rust 1.72 (#9562) 2023-08-25 12:34:24 +00:00
state.rs Document every public item in bevy_ecs (#8731) 2023-06-10 23:23:48 +00:00