aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/manager/EventManager.cpp
diff options
context:
space:
mode:
authorWboerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-11 19:40:58 +0100
committerGitHub <noreply@github.com>2024-12-11 19:40:58 +0100
commit59954bfc14cdb32997a3fb09e6ee1b393a4dc027 (patch)
treef1da5eeb955bc44fd4cf3bb22bcaf989116f0ef8 /src/crepe/manager/EventManager.cpp
parent30c17c98e54c1534664de08ca3838c40c859d166 (diff)
parenta464096dfff2ee4605e77852020e6a5c0fa5aa58 (diff)
Merge pull request #63 from lonkaars/wouter/gameloop
gameloop improvements + Singelton removal
Diffstat (limited to 'src/crepe/manager/EventManager.cpp')
-rw-r--r--src/crepe/manager/EventManager.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/crepe/manager/EventManager.cpp b/src/crepe/manager/EventManager.cpp
index 20f0dd3..6aa49ee 100644
--- a/src/crepe/manager/EventManager.cpp
+++ b/src/crepe/manager/EventManager.cpp
@@ -3,11 +3,9 @@
using namespace crepe;
using namespace std;
-EventManager & EventManager::get_instance() {
- static EventManager instance;
- return instance;
+EventManager::EventManager(Mediator & mediator) : Manager(mediator) {
+ this->mediator.event_manager = *this;
}
-
void EventManager::dispatch_events() {
for (auto & event : this->events_queue) {
this->handle_event(event.type, event.channel, *event.event.get());