aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/EventManager.cpp
diff options
context:
space:
mode:
authorWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-11-20 15:39:27 +0100
committerWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-11-20 15:39:27 +0100
commitce14236bd08469737185962d0be11d72c442b60e (patch)
tree90955cc17ce2573785e9010f5f3925e4ea683d5e /src/crepe/api/EventManager.cpp
parent881e8f286a553f393af7c698652521b5c125b1f7 (diff)
most tests done
Diffstat (limited to 'src/crepe/api/EventManager.cpp')
-rw-r--r--src/crepe/api/EventManager.cpp11
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();
+}