Entity Manager functions for the Brute Entity Component System
(add-component system entity instance)
Add a component instance to a given entity in the ES data structure and returns it.
Will overwrite a component if already set.
(add-entity system entity)
Add the entity to the ES Data Structure and returns it
Create the entity and return it. Entities are just UUIDs
Creates the system data structure that will need to be passed to all entity functions
(get-all-components-on-entity system entity)
Get all the components on a specific entity. Useful for debugging
Returns a list of all the entities. Not that useful in application, but good for debugging/testing
(get-all-entities-with-component system type)
Get all the entities that have a given component type
(get-component system entity type)
Get the component data for a specific component type
Returns the type for a given component. Using a multimethod with 'class' as the dispatch-fn to allow for extensibility per application.
By default returns the class of the component.
(kill-entity system entity)
Destroy an entity completely from the ES data structure and returns it
(remove-component system entity instance)
Remove a component instance from the ES data structure and returns it
(update-component system entity type fn & args)
Update an entity's component instance through through fn. Function is applied first with the specified component and any other args applied,
and should return the modified component instance. Return nil if you want no change to occur.