mirror of
https://github.com/bevyengine/bevy
synced 2024-12-24 03:53:06 +00:00
b9455afd0c
# 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. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
README.md |