/* * Author: Patrick-Christopher Mattulat * Company: Lynar Studios * E-Mail: webmaster@lynarstudios.com * Created: 2020-11-27 * Changed: 2020-11-27 * * */ #ifndef LS_STD_EVENT_MANAGER_HPP #define LS_STD_EVENT_MANAGER_HPP #include #include #include #include #include "EventHandler.hpp" namespace ls_std { class EventManager : public ls_std::Class { public: explicit EventManager(); ~EventManager() override = default; void addEventHandler(const std::shared_ptr& _eventHandler); void fire(ls_std::Event _event); void removeEventHandler(const std::shared_ptr& _eventHandler); private: std::map> eventHandlers {}; bool _hasEventHandler(const ls_std::event_id& _id); void _removeEventHandler(const std::shared_ptr& _eventHandler); }; } #endif