Skip to main content

beetry_node/
lib.rs

1//! # Beetry Node
2//!
3//! `beetry-node` provides the built-in control and decorator behavior tree
4//! nodes available by default in Beetry.
5//!
6//! Compatibility with the editor integration and plugin-based registration is
7//! guarded behind the `plugin` feature.
8
9mod control;
10mod decorator;
11
12#[cfg(feature = "plugin")]
13pub mod plugin;
14
15use beetry_core::NonEmptyNodes;
16pub use control::{Fallback, MemorySequence, Parallel, ParallelParams, Sequence};
17pub use decorator::{Fail, Invert, Succeed, UntilFailure, UntilSuccess};
18
19#[cfg(test)]
20mod mock;
21#[cfg(test)]
22pub(crate) use mock::test as mock_test;
23
24pub(crate) trait Indices {
25    fn indices(&self) -> std::ops::Range<usize>;
26}
27
28impl Indices for NonEmptyNodes {
29    fn indices(&self) -> std::ops::Range<usize> {
30        0..self.len().into()
31    }
32}