execs v0.5.0 Execs
Execs provides the data abstraction layer for an Entity-Component System. It uses a Mnesia client by default, with disc_copy tables. There is currently no other client though the framework is in place for one should the need arise.
All clients must implement the Execs.DbClient.Client behavior.
Summary
Functions
Create a single entity and return the id
Create the specified number of entities and return their ids
Delete a set of entities and all their data
Delete a set of components and all their data from a set of entities
Delete a set of keys from a set of components which belong to a set of entities
List the entities which have a set of components
List the entities which have a set of keys
List the entities which have a set of keys. The value associated with the each key is passed to each of the comparison functions. If all functions return true then there is a match
List the entities which have at least one of a set of components
List the entities which have at least one of a set of keys
List the entities which have at least one of a set of keys. The value associated with the each key is passed to each of the comparison functions. If all functions return true then there is a match
Check to see if a set of entities has a set of components
Check to see if a set of entities has set of keys
Check to see if a set of entities has set of keys. The value associated with the each key is passed to each of the comparison functions. If all functions return true then there is a match
Check to see if a set of entities has at least one of a set of components
Check to see if a set of entities has at least one of a set of keys
Check to see if a set of entities has at least one of a set of keys. The value associated with the each key is passed to each of the comparison functions. If all functions return true then there is a match
Check to see which of a set of components a set of entities has
Check to see which of a set of keys a set of entities has
Check to see which of a set of keys a set of entities has. The value associated with the each key is passed to each of the comparison functions. If all functions return true then there is a match
List the components of a set of entities
List the keys belonging to a set of components of a set of entities
Read a set of entities
Read a set of components belonging to a set of entities
Read a set of keys belonging to a set of entities. Providing anything other than a single id, component, and key will return a map otherwise a single value is returned
All data manipulation functions expect to be performed in the context of a transaction. This ensures all systems can run concurrently while safely accessing data
Write a value to any combination of keys, components, and entities
Types
Functions
Create a single entity and return the id.
Create the specified number of entities and return their ids.
Delete a set of entities and all their data.
Delete a set of components and all their data from a set of entities.
delete(maybe_id_list, maybe_component_list, maybe_key_list) :: maybe_entity_list
Delete a set of keys from a set of components which belong to a set of entities.
List the entities which have a set of components.
List the entities which have a set of keys.
find_with_all(maybe_component_list, maybe_key_list, maybe_fun_list) :: id_list
List the entities which have a set of keys. The value associated with the each key is passed to each of the comparison functions. If all functions return true then there is a match.
List the entities which have at least one of a set of components.
List the entities which have at least one of a set of keys.
find_with_any(maybe_component_list, maybe_key_list, maybe_fun_list) :: id_list
List the entities which have at least one of a set of keys. The value associated with the each key is passed to each of the comparison functions. If all functions return true then there is a match.
Check to see if a set of entities has a set of components.
has_all(maybe_id_list, maybe_component_list, maybe_key_list) :: maybe_id_match_list
Check to see if a set of entities has set of keys.
Check to see if a set of entities has set of keys. The value associated with the each key is passed to each of the comparison functions. If all functions return true then there is a match.
Check to see if a set of entities has at least one of a set of components.
has_any(maybe_id_list, maybe_component_list, maybe_key_list) :: maybe_id_match_list
Check to see if a set of entities has at least one of a set of keys.
Check to see if a set of entities has at least one of a set of keys. The value associated with the each key is passed to each of the comparison functions. If all functions return true then there is a match.
has_which(maybe_id_list, maybe_component_list) :: maybe_component_match_list
Check to see which of a set of components a set of entities has.
has_which(maybe_id_list, maybe_component_list, maybe_key_list) :: maybe_component_match_list
Check to see which of a set of keys a set of entities has.
Check to see which of a set of keys a set of entities has. The value associated with the each key is passed to each of the comparison functions. If all functions return true then there is a match.
List the components of a set of entities.
List the keys belonging to a set of components of a set of entities.
Read a set of entities.
Read a set of components belonging to a set of entities.
read(maybe_id_list, maybe_component_list, maybe_key_list) :: maybe_entity_list | any
Read a set of keys belonging to a set of entities. Providing anything other than a single id, component, and key will return a map otherwise a single value is returned.
All data manipulation functions expect to be performed in the context of a transaction. This ensures all systems can run concurrently while safely accessing data.
write(maybe_id_list, maybe_component_list, maybe_key_list, any) :: maybe_id_list
Write a value to any combination of keys, components, and entities.