pub enum EventCondition {
Trigger(TriggerCondition),
All(Vec<EventCondition>),
Any(Vec<EventCondition>),
}Expand description
Condition for scheduled events. Can wrap a TriggerCondition or combine multiple.
Variants§
Trigger(TriggerCondition)
Single trigger condition; evaluated via existing machinery.
All(Vec<EventCondition>)
All subconditions must be true.
Any(Vec<EventCondition>)
Any subcondition must be true.
Implementations§
Source§impl EventCondition
impl EventCondition
Sourcepub fn eval_with_events(
&self,
world: &AmbleWorld,
events: &[TriggerCondition],
) -> bool
pub fn eval_with_events( &self, world: &AmbleWorld, events: &[TriggerCondition], ) -> bool
Evaluate the condition against the current world state and any recent events.
Sourcepub fn eval(&self, world: &AmbleWorld) -> bool
pub fn eval(&self, world: &AmbleWorld) -> bool
Evaluate the condition against the current world state.
Sourcepub fn eval_ambient(&self, world: &AmbleWorld) -> bool
pub fn eval_ambient(&self, world: &AmbleWorld) -> bool
Determine whether the condition contains an Ambient that applies to the current player location.
Sourcepub fn any_trigger<F>(&self, matcher: F) -> bool
pub fn any_trigger<F>(&self, matcher: F) -> bool
Returns true if any nested trigger condition satisfies the matcher.
Sourcepub fn for_each_condition<F>(&self, visitor: F)where
F: FnMut(&TriggerCondition),
pub fn for_each_condition<F>(&self, visitor: F)where
F: FnMut(&TriggerCondition),
Apply a visitor closure to every nested trigger condition.
Trait Implementations§
Source§impl Clone for EventCondition
impl Clone for EventCondition
Source§fn clone(&self) -> EventCondition
fn clone(&self) -> EventCondition
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EventCondition
impl Debug for EventCondition
Source§impl<'de> Deserialize<'de> for EventCondition
impl<'de> Deserialize<'de> for EventCondition
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for EventCondition
impl PartialEq for EventCondition
Source§impl Serialize for EventCondition
impl Serialize for EventCondition
impl StructuralPartialEq for EventCondition
Auto Trait Implementations§
impl Freeze for EventCondition
impl RefUnwindSafe for EventCondition
impl Send for EventCondition
impl Sync for EventCondition
impl Unpin for EventCondition
impl UnsafeUnpin for EventCondition
impl UnwindSafe for EventCondition
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