diff options
Diffstat (limited to 'src/crepe/api/EventManager.cpp')
-rw-r--r-- | src/crepe/api/EventManager.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/crepe/api/EventManager.cpp b/src/crepe/api/EventManager.cpp index b465e89..27a304f 100644 --- a/src/crepe/api/EventManager.cpp +++ b/src/crepe/api/EventManager.cpp @@ -13,9 +13,9 @@ void EventManager::dispatch_events() { using HandlersVec = std::vector<std::unique_ptr<IEventHandlerWrapper>>; for (auto event_it = this->events_queue.begin(); event_it != this->events_queue.end();) { - std::unique_ptr<Event> & event = std::get<0>(*event_it); - int channel = std::get<1>(*event_it); - std::type_index event_type = std::get<2>(*event_it); + std::unique_ptr<Event> & event = (*event_it).event; + int channel = (*event_it).channel; + std::type_index event_type = (*event_it).type; bool event_handled = false; @@ -58,3 +58,8 @@ void EventManager::dispatch_events() { } } } +void EventManager::clear(){ + this->subscribers.clear(); + this->events_queue.clear(); + this->subscribers_by_event_id.clear(); +} |