pub enum Cond<P = ParamId> {
Always,
Is(P),
Trigger(P),
Above(P, f32),
Below(P, f32),
Finished,
After(f32),
Not(Box<Cond<P>>),
All(Vec<Cond<P>>),
Any(Vec<Cond<P>>),
}Variants§
Always
Always holds.
Is(P)
A bool parameter is on.
Trigger(P)
A trigger is pending. A transition that fires consumes the triggers it tested.
Above(P, f32)
A float parameter is above the value.
Below(P, f32)
A float parameter is below the value.
Finished
The state’s clip has finished (only Playback::Once clips do).
After(f32)
At least this many seconds in the state.
Not(Box<Cond<P>>)
The inner condition does not hold. Triggers under a Not are never consumed.
All(Vec<Cond<P>>)
Every inner condition holds.
Any(Vec<Cond<P>>)
At least one inner condition holds.
Implementations§
Source§impl Cond
impl Cond
Sourcepub fn eval(&self, p: &Params, finished: bool, time: f32) -> bool
pub fn eval(&self, p: &Params, finished: bool, time: f32) -> bool
Whether the condition holds, given the parameters, whether the clip finished and seconds in the state.
Sourcepub fn used_triggers(&self, p: &Params, out: &mut Vec<ParamId>)
pub fn used_triggers(&self, p: &Params, out: &mut Vec<ParamId>)
The pending triggers this condition tested positively, to consume when its transition fires.
Trait Implementations§
impl<P: PartialEq> StructuralPartialEq for Cond<P>
Auto Trait Implementations§
impl<P> Freeze for Cond<P>
impl<P> RefUnwindSafe for Cond<P>
impl<P> Send for Cond<P>
impl<P> Sync for Cond<P>
impl<P> Unpin for Cond<P>
impl<P> UnsafeUnpin for Cond<P>
impl<P> UnwindSafe for Cond<P>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.