Skip to content

Commit

Permalink
make ScheduleGraph::initialize public (bevyengine#7723)
Browse files Browse the repository at this point in the history
follow-up to bevyengine#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
  • Loading branch information
jakobhellermann authored and myreprise1 committed Feb 18, 2023
1 parent c0ed1b5 commit ea21822
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/bevy_ecs/src/schedule/schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit ea21822

Please sign in to comment.