1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! A simple library for defining and evaluating behaviour trees on an actor.
//!
//! ## Building A Behaviour Tree
//! ```rust
//!   let world_behaviour: Selector<World> = behaviour_selector!("World Root", [
//!       condition_decorator!("Ensure Can Shine",
//!           |world: &mut World| {
//!               world.can_shine()
//!           },
//!           action!("Cycle Day/Night", |world: &mut World| {
//!               world.toggle_sun()
//!           })
//!       ),
//!       condition_decorator!("Ensure Can Rain",
//!           |world: &mut World| {
//!               world.can_rain()
//!           },
//!           action!("Rain", |world: &mut World| {
//!               world.rain()
//!           })
//!       )
//!   ]);
//! ```
//! ## Evaluating A Behaviour Tree
//! ```rust
//!   world_behaviour.evaluate(&mut world);
//! ```
//!

#![doc(html_logo_url = "http://rust-lang.org/logos/rust-logo-128x128-blk.png",
       html_favicon_url = "http://rust-lang.org/favicon.ico",
       html_root_url = "https://archytaus.github.io/beehave/beehave")]

#![feature(fn_traits, unboxed_closures)]

pub use behaviour_result::BehaviourResult;
pub use behaviour_node::BehaviourNode;
pub use sequence::Sequence;
pub use selector::Selector;
pub use node::Node;
pub use action::Action;
pub use conditional::Conditional;
pub use conditional_decorator::ConditionalDecorator;

mod behaviour_result;
mod behaviour_node;

mod sequence;
mod selector;
mod node;
mod action;
mod conditional;
mod conditional_decorator;

#[macro_use]
pub mod macros;