From b2e1694c12cd8fd4e679d85fda76a8f75c7c559a Mon Sep 17 00:00:00 2001 From: Jakob Hellermann Date: Fri, 17 Feb 2023 20:25:28 +0000 Subject: [PATCH] make `ScheduleGraph::initialize` public (#7723) follow-up to https://github.com/bevyengine/bevy/pull/7716 # Objective System access is only populated in `System::initialize`, so without calling `initialize` it's actually impossible to see most ambiguities. ## Solution - make `initialize` public. The method is idempotent, so calling it multiple times doesn't hurt --- crates/bevy_ecs/src/schedule/schedule.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/bevy_ecs/src/schedule/schedule.rs b/crates/bevy_ecs/src/schedule/schedule.rs index addaa6c3c5..e12d5ef1a4 100644 --- a/crates/bevy_ecs/src/schedule/schedule.rs +++ b/crates/bevy_ecs/src/schedule/schedule.rs @@ -216,6 +216,8 @@ impl Schedule { /// Initializes any newly-added systems and conditions, rebuilds the executable schedule, /// and re-initializes the executor. + /// + /// Moves all systems and run conditions out of the [`ScheduleGraph`]. pub fn initialize(&mut self, world: &mut World) -> Result<(), ScheduleBuildError> { if self.graph.changed { self.graph.initialize(world); @@ -772,7 +774,8 @@ impl ScheduleGraph { Ok(()) } - fn initialize(&mut self, world: &mut World) { + /// Initializes any newly-added systems and conditions by calling [`System::initialize`] + pub fn initialize(&mut self, world: &mut World) { for (id, i) in self.uninit.drain(..) { match id { NodeId::System(index) => {