pkecs 8.0.0

Another ECS implementation.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use super::{event:: Events, schedule::Schedule};

/// Provides a single entrypoint for injecting functionality into an application.
pub trait Plugin {
    /// Adds the plugin's systems to an application's [`Schedule`].
    fn attach(self, events: &mut Events, schedule: &mut Schedule);
}

impl<T> Plugin for T
    where
        T: FnOnce(&mut Events, &mut Schedule),
{
    fn attach(self, events: &mut Events, schedule: &mut Schedule) {
        (self)(events, schedule);
    }
}