bevy/crates
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
..
bevy_a11y Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_animation Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_app Schedule resource mutation (#13193) 2024-05-03 12:40:32 +00:00
bevy_asset Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_audio Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_color Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_compile_test_utils Switch to ui_test in compile fail tests. (#12810) 2024-04-27 00:00:57 +00:00
bevy_core Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_core_pipeline Implement visibility ranges, also known as hierarchical levels of detail (HLODs). (#12916) 2024-05-03 00:11:35 +00:00
bevy_derive Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_dev_tools new format for ci config file (#13154) 2024-05-02 22:51:47 +00:00
bevy_diagnostic Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_dylib Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_dynamic_plugin Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_ecs Schedule resource mutation (#13193) 2024-05-03 12:40:32 +00:00
bevy_ecs_compile_fail_tests Switch to ui_test in compile fail tests. (#12810) 2024-04-27 00:00:57 +00:00
bevy_encase_derive Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_gilrs Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_gizmos Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_gltf Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_hierarchy Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_input Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_internal Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_log Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_macro_utils Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_macros_compile_fail_tests Switch to ui_test in compile fail tests. (#12810) 2024-04-27 00:00:57 +00:00
bevy_math Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_mikktspace Update glam version requirement from 0.25 to 0.27 (#12757) 2024-05-02 18:42:34 +00:00
bevy_pbr Add BufferVec, an higher-performance alternative to StorageBuffer, and make GpuArrayBuffer use it. (#13199) 2024-05-03 11:39:21 +00:00
bevy_ptr Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_reflect Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_reflect_compile_fail_tests Switch to ui_test in compile fail tests. (#12810) 2024-04-27 00:00:57 +00:00
bevy_render Add BufferVec, an higher-performance alternative to StorageBuffer, and make GpuArrayBuffer use it. (#13199) 2024-05-03 11:39:21 +00:00
bevy_scene Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_sprite Add BufferVec, an higher-performance alternative to StorageBuffer, and make GpuArrayBuffer use it. (#13199) 2024-05-03 11:39:21 +00:00
bevy_tasks Remove async-task as a dependency (#13071) 2024-04-23 14:57:55 +00:00
bevy_text Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_time Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_transform Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_ui Add BufferVec, an higher-performance alternative to StorageBuffer, and make GpuArrayBuffer use it. (#13199) 2024-05-03 11:39:21 +00:00
bevy_utils Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_window Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_winit Simplify winit runner exit code reporting (#13151) 2024-05-03 00:17:39 +00:00