bevy/crates
urben1680 1e47604506
Adding ScheduleGraph::contains_set (#16206)
# Objective

The schedule graph can easily confirm whether a set is contained or not.

This helps me in my personal project where I write an extension trait
for `Schedule` and I want to configure a specific set in its methods.
The set in question has a run condition though and I don't want to add
that condition to the same schedule as many times as the trait methods
are called. Since the non-pub set is unknown to the schedule until then,
a `contains_set` is sufficient.

It is probably trivial to add a method that returns an `Option<NodeId>`
as well but as I personally don't need it I did not add that. If it is
desired I can do so here though. It might be unneeded to have a
`contains_set` then because one could check `is_some` on the returned id
in that case.

An argument against that is that future changes may be easier if only a
`contains_set` needs to be ported.

## Solution

Added `ScheduleGraph::contains_set`.

## Testing

I put the below showcase code into a temporary unit test and it worked.
If wanted I add it as a test too but I did not see that other more
somewhat complicated methods have tests

---

## Showcase

```rs
#[derive(ScheduleLabel, Debug, Default, Clone, Copy, PartialEq, Eq, Hash)]
struct MySchedule;

#[derive(SystemSet, Debug, Default, Clone, Copy, PartialEq, Eq, Hash)]
struct MySet;

let mut schedule = Schedule::new(MySchedule);
assert_eq!(schedule.graph().contains_set(MySet), false);
schedule.configure_sets(MySet);
assert_eq!(schedule.graph().contains_set(MySet), true);
```
2024-11-03 16:16:24 +00:00
..
bevy_a11y Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
bevy_animation Undeprecate is_playing_animation (#16121) 2024-10-27 22:38:07 +00:00
bevy_app Improve SubApp documentation example (#16160) 2024-10-30 22:12:25 +00:00
bevy_asset Update notify-debouncer-full requirement from 0.3.1 to 0.4.0 (#16133) 2024-10-28 22:23:03 +00:00
bevy_audio Fix audio not playing (#15638) 2024-10-04 01:07:09 +00:00
bevy_color Make some associated functions of Color const (#16091) 2024-10-28 03:26:35 +00:00
bevy_core Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
bevy_core_pipeline Adding alpha_threshold to OrderIndependentTransparencySettings for user-level optimization (#16090) 2024-10-27 19:08:34 +00:00
bevy_derive move ANDROID_APP to bevy_window (#15585) 2024-10-02 03:01:06 +00:00
bevy_dev_tools fix bevy_dev_tools build (#16099) 2024-10-25 20:14:39 +00:00
bevy_diagnostic Use en-us locale for typos (#16037) 2024-10-20 18:55:17 +00:00
bevy_dylib Generate links to definition in source code pages on docs.rs and dev-docs.bevyengine.org (#12965) 2024-07-29 23:10:16 +00:00
bevy_ecs Adding ScheduleGraph::contains_set (#16206) 2024-11-03 16:16:24 +00:00
bevy_encase_derive Update `glam to 0.29, encase` to 0.10. (#15249) 2024-09-23 19:44:02 +00:00
bevy_gilrs Remove thiserror from bevy_gilrs (#15773) 2024-10-09 14:21:25 +00:00
bevy_gizmos Fix gizmos (#15836) 2024-10-10 22:04:04 +00:00
bevy_gltf Use en-us locale for typos (#16037) 2024-10-20 18:55:17 +00:00
bevy_hierarchy fix: add reflect to SceneInstanceReady and other observers/events (#16018) 2024-10-20 13:51:41 +00:00
bevy_image Use en-us locale for typos (#16037) 2024-10-20 18:55:17 +00:00
bevy_input Use en-us locale for typos (#16037) 2024-10-20 18:55:17 +00:00
bevy_internal Fix bevy_picking plugin suffixes (#16082) 2024-10-25 20:11:51 +00:00
bevy_log Use en-us locale for typos (#16037) 2024-10-20 18:55:17 +00:00
bevy_macro_utils Modify derive_label to support no_std environments (#15465) 2024-09-27 20:23:26 +00:00
bevy_math Implement Measured2d for Arc2d-based primitives. (#16213) 2024-11-03 16:12:31 +00:00
bevy_mesh Mesh::merge: count_vertices instead of initializing positions (#16024) 2024-10-31 17:06:32 +00:00
bevy_mikktspace Use en-us locale for typos (#16037) 2024-10-20 18:55:17 +00:00
bevy_pbr Adding alpha_threshold to OrderIndependentTransparencySettings for user-level optimization (#16090) 2024-10-27 19:08:34 +00:00
bevy_picking Add button_just_down and button_just_up methods to PointerInput (#16176) 2024-10-31 14:44:34 +00:00
bevy_ptr Reduce compile time of bevy_ptr::OwnedPtr::make function (#15644) 2024-10-28 21:15:00 +00:00
bevy_reflect Use en-us locale for typos (#16037) 2024-10-20 18:55:17 +00:00
bevy_remote remove reference to missing file in bevy_remote cargo.toml (#16057) 2024-10-22 20:21:19 +00:00
bevy_render Fix and improve MSAA documentation (#16196) 2024-10-31 21:34:04 +00:00
bevy_scene fix: add reflect to SceneInstanceReady and other observers/events (#16018) 2024-10-20 13:51:41 +00:00
bevy_sprite Fix bevy_picking plugin suffixes (#16082) 2024-10-25 20:11:51 +00:00
bevy_state Fix typo in bevy_ecs (#16195) 2024-10-31 19:20:01 +00:00
bevy_tasks Resolve unused_qualifications warnings (#16001) 2024-10-19 16:59:58 +00:00
bevy_text Use CosmicFontSystem in public bevy_text APIs and remove cosmic_text re-export (#16063) 2024-10-23 20:05:28 +00:00
bevy_time Use en-us locale for typos (#16037) 2024-10-20 18:55:17 +00:00
bevy_transform Remove thiserror from bevy_transform (#15761) 2024-10-09 14:27:30 +00:00
bevy_ui Remove the Globals binding from the box shadow shader (#16177) 2024-10-30 20:06:15 +00:00
bevy_utils More #[doc(fake_variadic)] goodness (#16108) 2024-10-27 19:01:50 +00:00
bevy_window Support prefers_home_indicator_hidden (#16005) 2024-10-31 16:09:30 +00:00
bevy_winit Correctly feature gate custom_cursor (#16093) 2024-11-02 01:47:32 +00:00