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
This commit is contained in:
Jakob Hellermann 2023-02-17 20:25:28 +00:00
parent b24ed8bb0c
commit b2e1694c12

View file

@ -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) => {