Skip to main content

ConditionHelpers

Trait ConditionHelpers 

Source
pub trait ConditionHelpers: Sized {
Show 13 methods // Required method fn run_if<Condition, Params>(self, condition: Condition) -> Self where Condition: IntoSystem<(), bool, Params>; // Provided methods fn run_if_not<Condition, Params>(self, condition: Condition) -> Self where Condition: IntoSystem<(), bool, Params> { ... } fn run_on_event<T: Send + Sync + 'static>(self) -> Self { ... } fn run_if_resource_exists<T: Resource>(self) -> Self { ... } fn run_unless_resource_exists<T: Resource>(self) -> Self { ... } fn run_if_resource_added<T: Resource>(self) -> Self { ... } fn run_if_resource_removed<T: Resource>(self) -> Self { ... } fn run_if_resource_equals<T: Resource + PartialEq>(self, value: T) -> Self { ... } fn run_unless_resource_equals<T: Resource + PartialEq>( self, value: T, ) -> Self { ... } fn run_in_state<T: StateData>(self, state: T) -> Self { ... } fn run_not_in_state<T: StateData>(self, state: T) -> Self { ... } fn run_in_bevy_state<T: StateData>(self, state: T) -> Self { ... } fn run_not_in_bevy_state<T: StateData>(self, state: T) -> Self { ... }
}
Expand description

Trait to help impl the default helper methods we provide for systems/sets

Required Methods§

Source

fn run_if<Condition, Params>(self, condition: Condition) -> Self
where Condition: IntoSystem<(), bool, Params>,

The base run condition; other methods impld in terms of this

Provided Methods§

Source

fn run_if_not<Condition, Params>(self, condition: Condition) -> Self
where Condition: IntoSystem<(), bool, Params>,

Helper: add a condition, but flip its result

Source

fn run_on_event<T: Send + Sync + 'static>(self) -> Self

Helper: add a condition to run if there are events of the given type

Source

fn run_if_resource_exists<T: Resource>(self) -> Self

Helper: add a condition to run if a resource of a given type exists

Source

fn run_unless_resource_exists<T: Resource>(self) -> Self

Helper: add a condition to run if a resource of a given type does not exist

Source

fn run_if_resource_added<T: Resource>(self) -> Self

Helper: add a condition to run if a resource was added

Source

fn run_if_resource_removed<T: Resource>(self) -> Self

Helper: add a condition to run if a resource was removed

Source

fn run_if_resource_equals<T: Resource + PartialEq>(self, value: T) -> Self

Helper: add a condition to run if a resource equals the given value

Source

fn run_unless_resource_equals<T: Resource + PartialEq>(self, value: T) -> Self

Helper: add a condition to run if a resource does not equal the given value

Source

fn run_in_state<T: StateData>(self, state: T) -> Self

Helper: run in a specific state (checks the CurrentState resource)

Source

fn run_not_in_state<T: StateData>(self, state: T) -> Self

Helper: run when not in a specific state (checks the CurrentState resource)

Source

fn run_in_bevy_state<T: StateData>(self, state: T) -> Self

Helper: run in a specific Bevy state (checks the State<T> resource)

Source

fn run_not_in_bevy_state<T: StateData>(self, state: T) -> Self

Helper: run when not in a specific Bevy state (checks the State<T> resource)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§