Lua
Events
Functions
Description
trigger an event with the c++ dispatcher
Entity Registry
Functions
Description
create an entity.
destroy an entity
get the numbers of entities
checks whether the requested component is associated with the given entity
get the component linked to the given entity
remove the component linked to the given entity
add the component to the given entity
Events API Documentation
shiva.dispatcher:trigger_[event_name]_event
This function trigger an event using the EnTT dispatcher.
All those functions are automatically generated based on shiva::event.
Parameters
Name
Description
evt_arg
type -> constructor of the current_event
Example
Entity Registry API Documentation
shiva.entity_registry:create
This function create an entity through the EnTT registry and return an unique identifier.
Return value
Possible name
Description
entity_id
integer
the entity identifier
Example
shiva.entity_registry:destroy
This function destroy an entity through the EnTT registry.
Parameters
Name
Description
entity_id
integer
the identifier of the entity to be destroyed.
Example
shiva.entity_registry:nb_entities
This function retrieve the number of entities through the EnTT registry
Return value
Possible name
Description
nb_entities
integer
the number of entities
Example
shiva.entity_registry:has_[component_name]_component
This function checks whether the requested component is associated with the given entity through the EnTT registry
All those functions are automatically generated based on the common components.
Parameters
Name
Description
entity_id
integer
the identifier of the entity to be verified
Return value
Possible name
Description
result
boolean
true if the entity has the component
false otherwise
Example
shiva.entity_registry:get_[component_name]_component
This function takes an entity as a parameter and retrieves the component associated with it through the EnTT registry.
All those functions are automatically generated based on the common components.
Parameters
Name
Description
entity_id
integer
the identifier of the entity to be get
Return value
Possible Name
Description
same_component
Component &
a reference on the requested component
Example
shiva.entity_registry:remove_[component_name]_component
This function takes an entity as a parameter and remove the component associated with it through the EnTT registry.
All those functions are automatically generated based on the common components.
Parameters
Name
Description
entity_id
integer
the identifier of the entity to be remove.
Example
shiva.entity_registry:add_[component_name]_component
This function takes an entity as a parameter and add the component through the EnTT registry, and return a reference to the component.
All those functions are automatically generated based on the common components.
Parameters
Name
Description
entity_id
integer
the identifier of the entity which will add the component
Return value
Possible name
Description
component
Component &
a reference on the created component
Example
Last updated