diff options
author | Wboerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-12-11 19:40:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-11 19:40:58 +0100 |
commit | 59954bfc14cdb32997a3fb09e6ee1b393a4dc027 (patch) | |
tree | f1da5eeb955bc44fd4cf3bb22bcaf989116f0ef8 /src/crepe/manager/EventManager.cpp | |
parent | 30c17c98e54c1534664de08ca3838c40c859d166 (diff) | |
parent | a464096dfff2ee4605e77852020e6a5c0fa5aa58 (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.cpp | 6 |
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()); |