shiva::event
On this page you will find information about the different events that can be sent and received in shiva
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.
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 |
All events are default constructible.
Constructor
Example
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>(...));
Constructor
Example
This event has no constructor
#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.
Constructor
Example
This event has no constructor
#include <memory>
#include <shiva/event/after_load_resources.hpp>
shiva::entt::dispatcher dispatcher;
dispatcher.trigger<shiva::event::after_load_resources>();
Constructor
Example
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));
Constructor
Example
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);
Constructor
Example
This event has no constructor
#include <memory>
#include <system_error>
#include <shiva/event/start_game.hpp>
shiva::entt::dispatcher dispatcher;
dispatcher.trigger<shiva::event::start_game>();
Constructor
Example
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);
Constructor
Example
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);
Constructor
Example
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 modified 4yr ago