Add AppBuilder::add_startup_stage_[before/after] (#505)

Co-authored-by: Boiethios <felix-dev@daudre-vignier.fr>
This commit is contained in:
Boiethios 2020-09-18 22:30:54 +02:00 committed by GitHub
parent 70ad6671db
commit d4c8436457
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -74,6 +74,28 @@ impl AppBuilder {
self
}
pub fn add_startup_stage_after(
&mut self,
target: &'static str,
stage_name: &'static str,
) -> &mut Self {
self.app
.startup_schedule
.add_stage_after(target, stage_name);
self
}
pub fn add_startup_stage_before(
&mut self,
target: &'static str,
stage_name: &'static str,
) -> &mut Self {
self.app
.startup_schedule
.add_stage_before(target, stage_name);
self
}
pub fn add_system(&mut self, system: Box<dyn System>) -> &mut Self {
self.add_system_to_stage(stage::UPDATE, system)
}