Lua

Events

Functions

Description

trigger an event with the c++ dispatcher

Entity Registry

Functions

Description

get the numbers of entities

checks whether the requested component is associated with 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.

-- Global signature
shiva.dispatcher:trigger_[event_name]_event(evt_arg);

-- Example of generated one
shiva.dispatcher:trigger_quit_game_event(evt_arg);

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.entityregistry: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

Last updated