API
EntityComponentSystem.World
— Type.World
A collection of entities and their components.
ECSComponent
A representation of an entity component system component.
EntityComponentSystem.EntityKey
— Type.EntityKey
A generational index to an entity that will fail in usage if the entity has been destroyed.
EntityComponentSystem.register!
— Method.register!(world::World,::Type{C}) where C <: ECSComponent
Registers storage space for a component type.
EntityComponentSystem.createentity!
— Method.createentity!(world::World)
Allocates an entity and returns an entity key.
EntityComponentSystem.getentity
— Method.getentity(world::World,key::EntityKey)
Returns entity index if entity key is still valid.
EntityComponentSystem.destroyentity!
— Method.destroyentity!(world::World,entity::EntityKey)
Deallocates entity and memory if entity key is valid.
EntityComponentSystem.addcomponent!
— Method.addcomponent!(world::World,entity::EntityKey,component::C) where C <: ECSComponent
Associate a component with an entity key.
EntityComponentSystem.removecomponent!
— Method.removecomponent!(world::World,entity::EntityKey,::Type{C}) where C <: ECSComponent
Dissociate a component of a specific type with an entity key.
EntityComponentSystem.getcomponent
— Method.getcomponent(world::World,entity::EntityKey,::Type{C}) where C <: ECSComponent
Get a component of a specific type of an entity key.
EntityComponentSystem.runsystem!
— Method.runsystem!(f,world::World,types::Array{DataType,1})
For each entity with components of passed in types, call provided function with that entity and components.