ecs?
This commit is contained in:
parent
0eeb4b2563
commit
ca57bce787
7 changed files with 177 additions and 484 deletions
15
crates/moonhare_ecs/src/lib.rs
Normal file
15
crates/moonhare_ecs/src/lib.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue