0.1.11 • Published 4 years ago
@ekx/ecs v0.1.11
entity - is stable int16 identifier used as index. 0 index used as invalid null-entity.
passport - is mix of entity index and cyclic version number (generation) to store and invalidate logical references to entity.
component_type - is data manager which control association of entity with some logical component and it's data.
component_handle - is index used to access component's data arrays.
Lifecycle
- user initialize ecs system
- user creates new entity (no
on_entity_createdcallback) - add new component to entity: component type
ctoris called. - remove component from entity: component type
dtoris called. - user destroy entity
- system clears entity from all components
on_entity_destroycallbacks fired
- user shutdown ecs system
- system destroys all component data (
dtorcalls for each created data) - call
shutdowncallback for each component type, here user should terminate temporary communication managers between ecs components and external systems.
- system destroys all component data (
- user shutdown external systems