shiva::event
On this page you will find information about the different events that can be sent and received in shiva
Purpose
The purpose of this module is to give users the opportunity to interact through events in their program, whether in C++ or in a scripting language.
Events
Event Name
Description
trigger an event that add a system in the system manager
triggers an event after the complete loading of plugged systems
triggers an event after the complete loading resource of a scene or program
triggers an event that indicates that an uncorrectable error has occurred
triggers an event that indicates the end of the program
triggers an event that indicates the beginning of the program
triggers an event if the user presses a key on his keyboard
triggers an event if the user release a key on his keyboard
triggers an event that indicates the change from one scene to another
add_base_system
add_base_system(std::unique_ptr<shiva::ecs::base_system> system_ptr_ = nullptr) noexcept#include <memory>
#include <shiva/event/add_base_system.hpp>
#include "conrete_system.hpp"
shiva::entt::dispatcher dispatcher;
dispatcher.trigger<shiva::event::add_base_system>(
std::make_unique<concrete_system>(...));after_load_systems_plugins
#include <memory>
#include <shiva/event/after_load_systems_plugins.hpp>
shiva::entt::dispatcher dispatcher;
dispatcher.trigger<shiva::event::after_load_systems_plugins>();We recommend that you do not trigger this event unless you use your own system manager.
after_load_resources
#include <memory>
#include <shiva/event/after_load_resources.hpp>
shiva::entt::dispatcher dispatcher;
dispatcher.trigger<shiva::event::after_load_resources>();You can find a more concrete example in the source code here
fatal_error_occured
fatal_error_occured(std::error_code ec) noexcept;#include <memory>
#include <system_error>
#include <shiva/event/fatal_error_occured.hpp>
shiva::entt::dispatcher dispatcher;
dispatcher.trigger<shiva::event::fatal_error_occured>(std::make_error_code(std::errc::result_out_of_range));You can find a more concrete example in the source code here
quit_game
quit_game(int return_value) noexcept;#include <memory>
#include <system_error>
#include <shiva/event/quit_game.hpp>
shiva::entt::dispatcher dispatcher;
dispatcher.trigger<shiva::event::quit_game>(0);You can find a more concrete example in the source code here
start_game
#include <memory>
#include <system_error>
#include <shiva/event/start_game.hpp>
shiva::entt::dispatcher dispatcher;
dispatcher.trigger<shiva::event::start_game>();You can find a more concrete example in the source code here
key_pressed
key_pressed(shiva::input::keyboard::TKey key) noexcept;#include <memory>
#include <system_error>
#include <shiva/event/key_pressed.hpp>
shiva::entt::dispatcher dispatcher;
dispatcher.trigger<shiva::event::key_pressed>(shiva::input::keyboard::TKey::A);You can find a more concrete example in the source code here
key_released
key_released(shiva::input::keyboard::TKey key) noexcept;#include <memory>
#include <system_error>
#include <shiva/event/key_released.hpp>
shiva::entt::dispatcher dispatcher;
dispatcher.trigger<shiva::event::key_released>(shiva::input::keyboard::TKey::A);change_scene
change_scene(const char* scene_name_ = nullptr) noexcept;#include <memory>
#include <system_error>
#include <shiva/event/change_scene.hpp>
shiva::entt::dispatcher dispatcher;
dispatcher.trigger<shiva::event::change_scene>("game_scene");Last updated