Struct bevy_ecs::schedule::State [−][src]
Stack based state machine
This state machine has four operations: Push, Pop, Set and Replace.
- Push pushes a new state to the state stack, pausing the previous state
- Pop removes the current state, and unpauses the last paused state
- Set replaces the active state with a new one
- Replace unwinds the state stack, and replaces the entire stack with a single new state
Implementations
impl<T> State<T> where
T: Component + Debug + Clone + Eq + Hash,
[src]
T: Component + Debug + Clone + Eq + Hash,
pub fn on_update(s: T) -> RunCriteriaDescriptor
[src]
pub fn on_inactive_update(s: T) -> RunCriteriaDescriptor
[src]
pub fn on_in_stack_update(s: T) -> RunCriteriaDescriptor
[src]
pub fn on_enter(s: T) -> RunCriteriaDescriptor
[src]
pub fn on_exit(s: T) -> RunCriteriaDescriptor
[src]
pub fn on_pause(s: T) -> RunCriteriaDescriptor
[src]
pub fn on_resume(s: T) -> RunCriteriaDescriptor
[src]
pub fn on_update_set(s: T) -> SystemSet
[src]
pub fn on_inactive_update_set(s: T) -> SystemSet
[src]
pub fn on_enter_set(s: T) -> SystemSet
[src]
pub fn on_exit_set(s: T) -> SystemSet
[src]
pub fn on_pause_set(s: T) -> SystemSet
[src]
pub fn on_resume_set(s: T) -> SystemSet
[src]
pub fn get_driver() -> SystemSet
[src]
Creates a driver set for the State.
Important note: this set must be inserted before all other state-dependant sets to work properly!
pub fn new(initial: T) -> Self
[src]
pub fn set(&mut self, state: T) -> Result<(), StateError>
[src]
Schedule a state change that replaces the active state with the given state.
This will fail if there is a scheduled operation, or if the given state
matches the
current state
pub fn overwrite_set(&mut self, state: T) -> Result<(), StateError>
[src]
Same as Self::set, but if there is already a next state, it will be overwritten instead of failing
pub fn replace(&mut self, state: T) -> Result<(), StateError>
[src]
Schedule a state change that replaces the full stack with the given state.
This will fail if there is a scheduled operation, or if the given state
matches the current state
pub fn overwrite_replace(&mut self, state: T) -> Result<(), StateError>
[src]
Same as Self::replace, but if there is already a next state, it will be overwritten instead of failing
pub fn push(&mut self, state: T) -> Result<(), StateError>
[src]
Same as Self::set, but does a push operation instead of a next operation
pub fn overwrite_push(&mut self, state: T) -> Result<(), StateError>
[src]
Same as Self::push, but if there is already a next state, it will be overwritten instead of failing
pub fn pop(&mut self) -> Result<(), StateError>
[src]
Same as Self::set, but does a pop operation instead of a set operation
pub fn overwrite_pop(&mut self) -> Result<(), StateError>
[src]
Same as Self::pop, but if there is already a next state, it will be overwritten instead of failing
pub fn current(&self) -> &T
[src]
pub fn inactives(&self) -> &[T]
[src]
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for State<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for State<T>
impl<T> Sync for State<T>
impl<T> Unpin for State<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for State<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Component for T where
T: 'static + Send + Sync,
[src]
T: 'static + Send + Sync,
impl<T> Downcast for T where
T: Any,
[src]
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
[src]
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
[src]
pub fn as_any(&self) -> &(dyn Any + 'static)
[src]
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<T> DowncastSync for T where
T: Any + Send + Sync,
[src]
T: Any + Send + Sync,
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,