Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Redo State architecture #1424

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 1 addition & 36 deletions crates/bevy_app/src/app_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ use crate::{
};
use bevy_ecs::{
component::Component,
schedule::{
RunOnce, Schedule, Stage, StageLabel, StateStage, SystemDescriptor, SystemSet, SystemStage,
},
schedule::{RunOnce, Schedule, Stage, StageLabel, SystemDescriptor, SystemSet, SystemStage},
system::{IntoExclusiveSystem, IntoSystem},
world::{FromWorld, World},
};
Expand Down Expand Up @@ -177,39 +175,6 @@ impl AppBuilder {
self
}

pub fn on_state_enter<T: Clone + Component>(
&mut self,
stage: impl StageLabel,
state: T,
system: impl Into<SystemDescriptor>,
) -> &mut Self {
self.stage(stage, |stage: &mut StateStage<T>| {
stage.on_state_enter(state, system)
})
}

pub fn on_state_update<T: Clone + Component>(
&mut self,
stage: impl StageLabel,
state: T,
system: impl Into<SystemDescriptor>,
) -> &mut Self {
self.stage(stage, |stage: &mut StateStage<T>| {
stage.on_state_update(state, system)
})
}

pub fn on_state_exit<T: Clone + Component>(
&mut self,
stage: impl StageLabel,
state: T,
system: impl Into<SystemDescriptor>,
) -> &mut Self {
self.stage(stage, |stage: &mut StateStage<T>| {
stage.on_state_exit(state, system)
})
}
TheRawMeatball marked this conversation as resolved.
Show resolved Hide resolved

pub fn add_default_stages(&mut self) -> &mut Self {
self.add_stage(
CoreStage::Startup,
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_ecs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub mod prelude {
query::{Added, Changed, Flags, Mutated, QueryState, With, WithBundle, Without},
schedule::{
AmbiguitySetLabel, ExclusiveSystemDescriptorCoercion, ParallelSystemDescriptorCoercion,
Schedule, Stage, StageLabel, State, StateStage, SystemLabel, SystemStage,
Schedule, Stage, StageLabel, State, SystemLabel, SystemStage,
},
system::{
Commands, In, IntoChainSystem, IntoExclusiveSystem, IntoSystem, Local, NonSend,
Expand Down
Loading