aboutsummaryrefslogtreecommitdiff
path: root/mwe/events/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mwe/events/src/main.cpp')
-rw-r--r--mwe/events/src/main.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/mwe/events/src/main.cpp b/mwe/events/src/main.cpp
index f7e0766..972fc70 100644
--- a/mwe/events/src/main.cpp
+++ b/mwe/events/src/main.cpp
@@ -4,6 +4,13 @@
#include <SDL2/SDL.h>
#include <iostream>
#include <memory>
+#include "loopManager.h"
+#include "event.h"
+#include "customTypes.h"
+#include "iKeyListener.h"
+#include "iMouseListener.h"
+#include "keyListenerTest.h"
+#include "mouseListenerTest.h"
class PlayerDamagedEvent : public Event {
public:
PlayerDamagedEvent(int damage, int playerID)
@@ -44,10 +51,9 @@ void testCollisionEvent() {
}
int main(int argc, char * args[]) {
LoopManager gameLoop;
- // Create an event handler for KeyPressedEvent
- // EventHandler<KeyPressedEvent> callback = [](const KeyPressedEvent& e) {
- // onKeyPressed(e);
- // };
+ int testListenerId = 0;
+ KeyListenerTest keyListener(testListenerId);
+ MouseListenerTest mouseListener(testListenerId);
// custom event class poc
subscribe<PlayerDamagedEvent>(onPlayerDamaged);
triggerEvent(PlayerDamagedEvent(50, 1));