bevy/crates/bevy_ecs/src
Lee-Orr b9455afd0c
Schedule resource mutation (#13193)
# Objective

Resolves #13185 

## Solution

Move the following methods from `sub_app` to the `Schedules` resource,
and use them in the sub app:

- `add_systems`
- `configure_sets`
- `ignore_ambiguity`

Add an `entry(&mut self, label: impl ScheduleLabel) -> &mut Schedule`
method to the `Schedules` resource, which returns a mutable reference to
the schedule associated with the label, and creates one if it doesn't
already exist. (build on top of the `entry(..).or_insert_with(...)`
pattern in `HashMap`.

## Testing

- Did you test these changes? If so, how? Added 4 unit tests to the
`schedule.rs` - one that validates adding a system to an existing
schedule, one that validates adding a system to a new one, one that
validates configuring sets on an existing schedule, and one that
validates configuring sets on a new schedule.
- I didn't add tests for `entry` since the previous 4 tests use
functions that rely on it.
- I didn't test `ignore_ambiguity` since I didn't see examples of it's
use, and am not familiar enough with it to know how to set up a good
test for it. However, it relies on the `entry` method as well, so it
should work just like the other 2 methods.
2024-05-03 12:40:32 +00:00
..
entity Fix beta lints (#12980) 2024-04-16 02:46:46 +00:00
identifier Fix beta lints (#12980) 2024-04-16 02:46:46 +00:00
query chore: fix some comments (#13083) 2024-04-25 19:09:16 +00:00
reflect Make from_reflect_or_world also try ReflectDefault and improve some comments and panic messages (#12499) 2024-04-30 00:48:46 +00:00
schedule Schedule resource mutation (#13193) 2024-05-03 12:40:32 +00:00
storage Fix uses of "it's" vs "its". (#13033) 2024-04-19 18:17:31 +00:00
system add schedule docs (#13174) 2024-05-02 18:31:32 +00:00
world Fix uses of "it's" vs "its". (#13033) 2024-04-19 18:17:31 +00:00
archetype.rs Adding some docs for archetype internals (#12578) 2024-03-23 01:48:31 +00:00
batching.rs Parallel event reader (#12554) 2024-04-22 16:37:42 +00:00
bundle.rs Fix uses of "it's" vs "its". (#13033) 2024-04-19 18:17:31 +00:00
change_detection.rs Update docs of set_if_neq and replace_if_neq (#12919) 2024-04-15 12:38:38 +00:00
component.rs Fix uses of "it's" vs "its". (#13033) 2024-04-19 18:17:31 +00:00
event.rs Add Reflect derive to Events and contained types (#13149) 2024-05-01 18:47:11 +00:00
intern.rs Moves intern and label modules into bevy_ecs (#12772) 2024-04-08 15:34:11 +00:00
label.rs Use ptr::from_ref and ptr::addr_eq in macro (#13081) 2024-04-24 01:54:24 +00:00
lib.rs Computed State & Sub States (#11426) 2024-05-02 19:36:23 +00:00
removal_detection.rs Add RemovedComponentEvents::iter (#12815) 2024-04-01 20:20:30 +00:00