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
//! The behaviour-component macro shared by every callback family.
//!
//! A behaviour component is the library's replacement for a system: a
//! component that holds a closure and is invoked by whatever driver the caller
//! writes. Every family — the portable input callbacks and the winit callbacks
//! — has the same shape, so one macro declares them all and the shape cannot
//! drift between families.
//!
//! The macro is invoked from other modules, so every path it writes is
//! `$crate`-absolute: a `macro_rules!` body resolves bare names in the module
//! it is *invoked* from, not the one it is defined in.
pub use ;
/// A callback that may read and write the world, and receives the entity it
/// runs for together with one event.
pub type EventCallback<E> = ;
/// Declares one behaviour component over an event type.
///
/// Every behaviour is the same shape [`unlit_ecs`]' own behaviour components
/// use: a public boxed closure, a `new` that boxes a caller's closure, and a
/// `run` that calls it. Events are passed by reference, so the world can hold
/// one copy of an event that several behaviours read.
///
/// A `run` takes the world and the entity the behaviour sits on, so the
/// callback can tell which entity it is acting for — one closure may be
/// mounted on many.
pub use behaviour;