diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-12-04 22:57:45 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-12-04 22:57:45 +0100 |
commit | 26c3fb80fd3bf84968a1e464df518a0b6db6c5d9 (patch) | |
tree | ca3a964f1de0357097ae59024881c27c50751d86 /src/test | |
parent | a199b953d634426b48224487b478649e3937ee10 (diff) |
fixed changes with mediator
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/InputTest.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/test/InputTest.cpp b/src/test/InputTest.cpp index f9b2fe7..73a9651 100644 --- a/src/test/InputTest.cpp +++ b/src/test/InputTest.cpp @@ -1,12 +1,13 @@ #include <gtest/gtest.h> #define protected public #define private public -#include "api/EventManager.h" +#include "manager/EventManager.h" +#include "manager/ComponentManager.h" #include "api/KeyCodes.h" #include "system/InputSystem.h" #include <SDL2/SDL.h> #include <SDL2/SDL_keycode.h> -#include <crepe/ComponentManager.h> +#include "manager/Mediator.h" #include <crepe/api/Button.h> #include <crepe/api/Camera.h> #include <crepe/api/GameObject.h> @@ -21,14 +22,19 @@ using namespace crepe; class InputTest : public ::testing::Test { public: - ComponentManager mgr{}; - InputSystem input_system{mgr}; + Mediator mediator; + ComponentManager mgr{mediator}; + + InputSystem input_system{mediator}; EventManager & event_manager = EventManager::get_instance(); //GameObject camera; protected: - void SetUp() override { event_manager.clear(); } + void SetUp() override { + mediator.event_manager = event_manager; + mediator.component_manager = mgr; + event_manager.clear(); } void simulate_mouse_click(int mouse_x, int mouse_y, Uint8 mouse_button) { SDL_Event event; |