diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-11-16 15:26:48 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-11-16 15:26:48 +0100 |
commit | 8209678e20605936b2ce58331c1a65d8f23fee91 (patch) | |
tree | 6a8c1e236eb1cee716a6a17bc504af3ac29555b6 /src/crepe/api/EventManager.hpp | |
parent | 027e67b32a9cca3cac4a186e73fdcc42faeab8c4 (diff) |
make format
Diffstat (limited to 'src/crepe/api/EventManager.hpp')
-rw-r--r-- | src/crepe/api/EventManager.hpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/crepe/api/EventManager.hpp b/src/crepe/api/EventManager.hpp index 1e505f4..d901492 100644 --- a/src/crepe/api/EventManager.hpp +++ b/src/crepe/api/EventManager.hpp @@ -4,7 +4,8 @@ namespace crepe { template <typename EventType> void EventManager::subscribe(EventHandler<EventType> && callback, int channel) { - using HandlersMap = std::unordered_map<int, std::vector<std::unique_ptr<IEventHandlerWrapper>>>; + using HandlersMap = std::unordered_map< + int, std::vector<std::unique_ptr<IEventHandlerWrapper>>>; using HandlersVec = std::vector<std::unique_ptr<IEventHandlerWrapper>>; std::type_index event_type = typeid(EventType); @@ -29,7 +30,8 @@ template <typename EventType> void EventManager::queue_event(EventType && event, int channel) { std::type_index event_type = std::type_index(typeid(EventType)); - auto event_ptr = std::make_unique<EventType>(std::forward<EventType>(event)); + auto event_ptr + = std::make_unique<EventType>(std::forward<EventType>(event)); std::tuple<std::unique_ptr<Event>, int, std::type_index> tuple( std::move(event_ptr), channel, event_type); @@ -38,7 +40,8 @@ void EventManager::queue_event(EventType && event, int channel) { template <typename EventType> void EventManager::trigger_event(const EventType & event, int channel) { - using HandlersMap = std::unordered_map<int, std::vector<std::unique_ptr<IEventHandlerWrapper>>>; + using HandlersMap = std::unordered_map< + int, std::vector<std::unique_ptr<IEventHandlerWrapper>>>; using HandlersVec = std::vector<std::unique_ptr<IEventHandlerWrapper>>; std::type_index event_type = std::type_index(typeid(EventType)); @@ -68,8 +71,10 @@ void EventManager::trigger_event(const EventType & event, int channel) { } template <typename EventType> -void EventManager::unsubscribe(const EventHandler<EventType> & callback, int channel) { - using HandlersMap = std::unordered_map<int, std::vector<std::unique_ptr<IEventHandlerWrapper>>>; +void EventManager::unsubscribe(const EventHandler<EventType> & callback, + int channel) { + using HandlersMap = std::unordered_map< + int, std::vector<std::unique_ptr<IEventHandlerWrapper>>>; using HandlersVec = std::vector<std::unique_ptr<IEventHandlerWrapper>>; std::type_index event_type(typeid(EventType)); |