Skip to content

Commit

Permalink
fix nits
Browse files Browse the repository at this point in the history
  • Loading branch information
MiniaczQ committed Jun 9, 2024
1 parent 34a8f70 commit 8187a21
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions crates/bevy_state/src/state/transitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,23 @@ pub struct StateTransitionEvent<S: States> {
pub entered: Option<S>,
}

/// Applies manual state transitions using [`NextState<S>`].
/// Applies state transitions and runs transitions schedules in order.
///
/// These system sets are run sequentially, in the order of the enum variants.
#[derive(SystemSet, Clone, Debug, PartialEq, Eq, Hash)]
pub(crate) enum StateTransitionSteps {
/// Parentless states apply their [`NextState<S>`].
RootTransitions,
/// States with parents apply their computation and [`NextState<S>`].
/// States apply their transitions from [`NextState`] and compute funcitons based on their parent states.

Check warning on line 61 in crates/bevy_state/src/state/transitions.rs

View workflow job for this annotation

GitHub Actions / typos

"funcitons" should be "functions".
DependentTransitions,
/// Exit schedules are executed in leaf-root order
/// Exit schedules are executed in leaf to root order
ExitSchedules,
/// Transition schedules are executed in arbitrary order.
TransitionSchedules,
/// Enter schedules are executed in root-leaf order.
/// Enter schedules are executed in root to leaf order.
EnterSchedules,
}

#[derive(SystemSet, Clone, Debug, PartialEq, Eq, Hash)]
/// Exit schedules are executed.
/// System set that runs exit schedule(s) for state `S`.
pub struct ExitSchedules<S: States>(PhantomData<S>);

impl<S: States> Default for ExitSchedules<S> {
Expand All @@ -81,7 +79,7 @@ impl<S: States> Default for ExitSchedules<S> {
}

#[derive(SystemSet, Clone, Debug, PartialEq, Eq, Hash)]
/// Transition schedules are executed.
/// System set that runs transition schedule(s) for state `S`.
pub struct TransitionSchedules<S: States>(PhantomData<S>);

impl<S: States> Default for TransitionSchedules<S> {
Expand All @@ -91,7 +89,7 @@ impl<S: States> Default for TransitionSchedules<S> {
}

#[derive(SystemSet, Clone, Debug, PartialEq, Eq, Hash)]
/// Enter schedules are executed.
/// System set that runs enter schedule(s) for state `S`.
pub struct EnterSchedules<S: States>(PhantomData<S>);

impl<S: States> Default for EnterSchedules<S> {
Expand All @@ -100,7 +98,7 @@ impl<S: States> Default for EnterSchedules<S> {
}
}

/// Defines a system set to aid with dependent state ordering.
/// System set that applies transitions for state `S`.
#[derive(SystemSet, Clone, Debug, PartialEq, Eq, Hash)]
pub(crate) struct ApplyStateTransition<S: States>(PhantomData<S>);

Expand Down

0 comments on commit 8187a21

Please sign in to comment.