Skip to content

Commit

Permalink
initialize chained systems (#886)
Browse files Browse the repository at this point in the history
  • Loading branch information
cart committed Nov 18, 2020
1 parent 457a8bd commit 4fecb89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crates/bevy_ecs/src/system/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ pub trait System: Send + Sync + 'static {
unsafe { self.run_unsafe(input, world, resources) }
}
fn run_thread_local(&mut self, world: &mut World, resources: &mut Resources);
fn initialize(&mut self, _world: &mut World, _resources: &mut Resources) {}
fn initialize(&mut self, _world: &mut World, _resources: &mut Resources);
}
5 changes: 5 additions & 0 deletions crates/bevy_ecs/src/system/system_chaining.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ impl<SystemA: System, SystemB: System<Input = SystemA::Output>> System
self.system_a.run_thread_local(world, resources);
self.system_b.run_thread_local(world, resources);
}

fn initialize(&mut self, world: &mut World, resources: &mut Resources) {
self.system_a.initialize(world, resources);
self.system_b.initialize(world, resources);
}
}

pub trait IntoChainSystem<AParams, BParams, IntoB, SystemA, SystemB>:
Expand Down

0 comments on commit 4fecb89

Please sign in to comment.