pub(crate) use std::any::{Any, TypeId};
pub type Entity = usize;
pub mod component;
pub use component::{Component, ComponentKey};
mod world;
pub use world::World;
pub mod query;
pub use query::{Exclude, Filter, Query, Queryable};
pub mod system;
pub use system::{QuerySystem, System, SystemManager};
#[cfg(test)]
mod tests {
use super::*;
struct Tag;
crate::component!(Tag);
#[allow(dead_code)]
struct Name(String);
crate::component!(Name);
#[allow(dead_code)]
struct Point(i32, i32);
crate::component!(Point);
#[test]
fn stress() {
let mut world = World::new();
for i in 0..10000 {
let entity = world.spawn();
world.add(entity, Tag);
world.add(entity, Point(i, 65));
world.add(entity, Name("Cronus".to_string()));
}
assert!(world.has::<Tag>(3));
}
}