Simple entity-component system in pure Rust. Type reflection - no macros!
Visit the crates.io page, and add the
specified line ("recs = ...
") to the [dependencies]
section of your
Cargo.toml. Then cargo build
should automatically download and compile
Rustic ECS.
Run cargo doc
, then open target/doc/recs/index.html
in your browser.
``` extern crate recs; use recs::{Ecs, EntityId};
struct Age{years: u32}
struct Brain{iq: i32}
fn main() {
// Create an ECS instance
let mut ecs: Ecs = Ecs::new();
// Add entity to the system
let me: EntityId = ecs.create_entity();
// Attach component to the entity
ecs.set(me, &Age{years: 22});
// Get attached component data from entity
let older = ecs.get::
MIT. Hooray!