gallium_ecs 0.2.0

A simple entity-component-system crate for rust with serialization support
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::{Scene, World};

/** To be inherited by each ecs system */
#[typetag::serde(tag = "system")]
pub trait System {
    /** Tick the system */
    fn tick(&self, _scene: &mut Scene, _world: &mut World) {}
    /** Handle game event */
    fn on_event(
        &self,
        _scene: &mut Scene,
        _world: &mut World,
        _tag: &str,
        _data: &dyn std::any::Any,
    ) {
    }
}