Skip to content

Commit

Permalink
Change the label from an enum to a unit type
Browse files Browse the repository at this point in the history
  • Loading branch information
MinerSebas committed Jul 5, 2021
1 parent 6470983 commit 29a92a8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
14 changes: 7 additions & 7 deletions crates/bevy_app/src/app_builder.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
app::{App, AppExit},
plugin::Plugin,
CoreSchedule, CoreStage, PluginGroup, PluginGroupBuilder, StartupStage,
CoreStage, PluginGroup, PluginGroupBuilder, StartupSchedule, StartupStage,
};
use bevy_ecs::{
component::{Component, ComponentDescriptor},
Expand Down Expand Up @@ -111,7 +111,7 @@ impl AppBuilder {
pub fn add_startup_stage<S: Stage>(&mut self, label: impl StageLabel, stage: S) -> &mut Self {
self.app
.schedule
.stage(CoreSchedule::Startup, |schedule: &mut Schedule| {
.stage(StartupSchedule, |schedule: &mut Schedule| {
schedule.add_stage(label, stage)
});
self
Expand All @@ -125,7 +125,7 @@ impl AppBuilder {
) -> &mut Self {
self.app
.schedule
.stage(CoreSchedule::Startup, |schedule: &mut Schedule| {
.stage(StartupSchedule, |schedule: &mut Schedule| {
schedule.add_stage_after(target, label, stage)
});
self
Expand All @@ -139,7 +139,7 @@ impl AppBuilder {
) -> &mut Self {
self.app
.schedule
.stage(CoreSchedule::Startup, |schedule: &mut Schedule| {
.stage(StartupSchedule, |schedule: &mut Schedule| {
schedule.add_stage_before(target, label, stage)
});
self
Expand Down Expand Up @@ -246,7 +246,7 @@ impl AppBuilder {
) -> &mut Self {
self.app
.schedule
.stage(CoreSchedule::Startup, |schedule: &mut Schedule| {
.stage(StartupSchedule, |schedule: &mut Schedule| {
schedule.add_system_to_stage(stage_label, system)
});
self
Expand All @@ -259,7 +259,7 @@ impl AppBuilder {
) -> &mut Self {
self.app
.schedule
.stage(CoreSchedule::Startup, |schedule: &mut Schedule| {
.stage(StartupSchedule, |schedule: &mut Schedule| {
schedule.add_system_set_to_stage(stage_label, system_set)
});
self
Expand Down Expand Up @@ -293,7 +293,7 @@ impl AppBuilder {
pub fn add_default_stages(&mut self) -> &mut Self {
self.add_stage(CoreStage::First, SystemStage::parallel())
.add_stage(
CoreSchedule::Startup,
StartupSchedule,
Schedule::default()
.with_run_criteria(RunOnce::default())
.with_stage(StartupStage::PreStartup, SystemStage::parallel())
Expand Down
10 changes: 4 additions & 6 deletions crates/bevy_app/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ pub use schedule_runner::*;
pub mod prelude {
#[doc(hidden)]
pub use crate::{
app::App, app_builder::AppBuilder, CoreSchedule, CoreStage, DynamicPlugin, Plugin,
PluginGroup, StartupStage,
app::App, app_builder::AppBuilder, CoreStage, DynamicPlugin, Plugin, PluginGroup,
StartupSchedule, StartupStage,
};
}

Expand All @@ -42,11 +42,9 @@ pub enum CoreStage {
}

/// The names of the default App schedules
/// Runs once at the beginning of the app.
#[derive(Debug, Hash, PartialEq, Eq, Clone, StageLabel)]
pub enum CoreSchedule {
/// Runs once at the beginning of the app.
Startup,
}
pub struct StartupSchedule;

/// The names of the default App startup stages
#[derive(Debug, Hash, PartialEq, Eq, Clone, StageLabel)]
Expand Down

0 comments on commit 29a92a8

Please sign in to comment.