pub enum BlackboardCondition {
HasKey(String),
NotHasKey(String),
KeyEquals(String, BlackboardValue),
KeyGreaterThan(String, f64),
KeyLessThan(String, f64),
KeyInRange(String, f64, f64),
IsTrue(String),
IsFalse(String),
And(Box<BlackboardCondition>, Box<BlackboardCondition>),
Or(Box<BlackboardCondition>, Box<BlackboardCondition>),
Not(Box<BlackboardCondition>),
}Expand description
A condition that can be evaluated against a Blackboard.
Primarily for use in behavior tree guard nodes.
Variants§
HasKey(String)
True if the key exists (and has not expired).
NotHasKey(String)
True if the key does NOT exist (or has expired).
KeyEquals(String, BlackboardValue)
True if the value at key equals the given BlackboardValue.
KeyGreaterThan(String, f64)
True if the numeric value at key is strictly greater than threshold.
KeyLessThan(String, f64)
True if the numeric value at key is strictly less than threshold.
KeyInRange(String, f64, f64)
True if the numeric value at key is >= min and <= max.
IsTrue(String)
True if the boolean at key is true.
IsFalse(String)
True if the boolean at key is false (or absent).
And(Box<BlackboardCondition>, Box<BlackboardCondition>)
Logical AND of two conditions.
Or(Box<BlackboardCondition>, Box<BlackboardCondition>)
Logical OR of two conditions.
Not(Box<BlackboardCondition>)
Logical NOT of a condition.
Implementations§
Source§impl BlackboardCondition
impl BlackboardCondition
Sourcepub fn evaluate(&self, bb: &Blackboard) -> bool
pub fn evaluate(&self, bb: &Blackboard) -> bool
Evaluate this condition against the given blackboard.
pub fn and(self, other: BlackboardCondition) -> BlackboardCondition
pub fn or(self, other: BlackboardCondition) -> BlackboardCondition
pub fn not(self) -> BlackboardCondition
Trait Implementations§
Source§impl Clone for BlackboardCondition
impl Clone for BlackboardCondition
Source§impl Debug for BlackboardCondition
impl Debug for BlackboardCondition
Source§impl PartialEq for BlackboardCondition
impl PartialEq for BlackboardCondition
impl StructuralPartialEq for BlackboardCondition
Auto Trait Implementations§
impl Freeze for BlackboardCondition
impl RefUnwindSafe for BlackboardCondition
impl Send for BlackboardCondition
impl Sync for BlackboardCondition
impl Unpin for BlackboardCondition
impl UnsafeUnpin for BlackboardCondition
impl UnwindSafe for BlackboardCondition
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.