Moonhare_Engine/crates/moonhare_ecs/src/lib.rs
2025-08-04 01:47:13 +02:00

15 lines
No EOL
444 B
Rust

use anymap::AnyMap;
use crate::generational_index::{GenerationalIndex, GenerationalIndexAllocator, GenerationalIndexArray};
pub mod generational_index;
pub type Entity = GenerationalIndex;
pub type EntityMap<T> = GenerationalIndexArray<T>;
// based on: https://kyren.github.io/2018/09/14/rustconf-talk.html
pub struct ECS {
pub entity_allocator: GenerationalIndexAllocator,
pub entity_components: AnyMap,
pub resources: AnyMap
}