RepeatUntilFail

Struct RepeatUntilFail 

Source
pub struct RepeatUntilFail<B: Bhv>(/* private fields */);
Expand description

A decorator that runs the given node until it returns Status::Failure.

It returns Status::Running until the node returns Status::Failure, in which case it is propagated.

Trait Implementations§

Source§

impl<B: Bhv> Bhv for RepeatUntilFail<B>

Source§

type Context = <B as Bhv>::Context

The context passed to the node every frame.
Source§

fn update(&mut self, ctx: &mut Self::Context) -> Status

Update the state of the behavior tree based on some global context.
Source§

fn reset(&mut self, _status: Status)

Reset the node to initial status after completion, if needed. Defaults to nothing.
Source§

fn execute(self, ctx: &mut Self::Context) -> bool
where Self: Sized,

Update the node until it returns a value different from Status::Running. Read more
Source§

impl<B: Clone + Bhv> Clone for RepeatUntilFail<B>

Source§

fn clone(&self) -> RepeatUntilFail<B>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<B> Freeze for RepeatUntilFail<B>
where B: Freeze,

§

impl<B> RefUnwindSafe for RepeatUntilFail<B>
where B: RefUnwindSafe,

§

impl<B> Send for RepeatUntilFail<B>
where B: Send,

§

impl<B> Sync for RepeatUntilFail<B>
where B: Sync,

§

impl<B> Unpin for RepeatUntilFail<B>
where B: Unpin,

§

impl<B> UnwindSafe for RepeatUntilFail<B>
where B: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<B> BhvExt for B
where B: Bhv,

Source§

fn inv(self) -> Inv<Self>

Return a node that inverts the result of this node. Read more
Source§

fn pass(self) -> Pass<Self>

Return a node that runs this node and returns Status::Success when done. Read more
Source§

fn fail(self) -> Fail<Self>

Return a node that runs this node and returns Status::Failure when done. Read more
Source§

fn run_if<C>(self, cond: C) -> RunIf<Self, C>
where C: Fn(&Self::Context) -> bool,

Return a node that runs this node as long as the specified condition holds true. Read more
Source§

fn repeat(self, count: u32) -> Repeat<Self>

Return a node that runs this node the given number of times and returns the last exit status when done. Read more
Source§

fn repeat_until<C>(self, cond: C) -> RepeatUntil<Self, C>
where C: Fn(&Self::Context) -> bool,

Return a node that runs this node then checks the passed condition until the condition returns true. The node then returns the last exit status when done. Read more
Source§

fn repeat_until_pass(self) -> RepeatUntilPass<Self>

Return a node that runs this node until it returns Status::Success. Read more
Source§

fn repeat_until_fail(self) -> RepeatUntilFail<Self>

Return a node that runs this node until it returns Status::Failure. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.