ecs-tiny
A minimal ECS supporting entity and component insertion/removal, association, and single-type iteration.
Usages
// Create new ecs instance and inserts new entity:
let mut ecs = ECS new;
let entity_key0 = ecs.insert_entity;
let entity_key1 = ecs.insert_entity;
// Register new component type:
ecs..unwrap;
ecs..unwrap;
// Inserts new component associated with specified entity:
let comp_key0 = ecs.insert_comp.unwrap;
let comp_key1 = ecs.insert_comp.unwrap;
let comp_key2 = ecs.insert_comp.unwrap;
let comp_key3 = ecs.insert_comp.unwrap;
// Iterates over all components associated with specified entity:
for comp in ecs..unwrap
// Iterates over all components of specified type (single type only):
for comp in ecs..unwrap
// Removes specified component:
ecs..unwrap;
// Removes specified entity:
ecs.remove_entity.unwrap;