diff options
-rw-r--r-- | src/crepe/facade/SDLContext.cpp | 2 | ||||
-rw-r--r-- | src/crepe/system/InputSystem.cpp | 9 | ||||
-rw-r--r-- | src/test/InputTest.cpp | 13 |
3 files changed, 12 insertions, 12 deletions
diff --git a/src/crepe/facade/SDLContext.cpp b/src/crepe/facade/SDLContext.cpp index 645a24f..88804ef 100644 --- a/src/crepe/facade/SDLContext.cpp +++ b/src/crepe/facade/SDLContext.cpp @@ -17,9 +17,9 @@ #include "../api/Camera.h" #include "../api/Config.h" -#include "../manager/EventManager.h" #include "../api/Sprite.h" #include "../api/Texture.h" +#include "../manager/EventManager.h" #include "../util/Log.h" #include "SDLContext.h" diff --git a/src/crepe/system/InputSystem.cpp b/src/crepe/system/InputSystem.cpp index 4a7f115..7cc8d30 100644 --- a/src/crepe/system/InputSystem.cpp +++ b/src/crepe/system/InputSystem.cpp @@ -1,14 +1,13 @@ +#include "../api/Button.h" #include "../manager/ComponentManager.h" #include "../manager/EventManager.h" -#include "../api/Button.h" - #include "InputSystem.h" using namespace crepe; void InputSystem::update() { - ComponentManager& mgr = this->mediator.component_manager; + ComponentManager & mgr = this->mediator.component_manager; EventManager & event_mgr = this->mediator.event_manager; std::vector<SDLContext::EventData> event_list = SDLContext::get_instance().get_events(); RefVector<Button> buttons = mgr.get_components_by_type<Button>(); @@ -119,7 +118,7 @@ void InputSystem::update() { } void InputSystem::handle_move(const SDLContext::EventData & event_data, const int world_mouse_x, const int world_mouse_y) { - ComponentManager& mgr = this->mediator.component_manager; + ComponentManager & mgr = this->mediator.component_manager; RefVector<Button> buttons = mgr.get_components_by_type<Button>(); @@ -147,7 +146,7 @@ void InputSystem::handle_move(const SDLContext::EventData & event_data, void InputSystem::handle_click(const MouseButton & mouse_button, const int world_mouse_x, const int world_mouse_y) { - ComponentManager& mgr = this->mediator.component_manager; + ComponentManager & mgr = this->mediator.component_manager; RefVector<Button> buttons = mgr.get_components_by_type<Button>(); diff --git a/src/test/InputTest.cpp b/src/test/InputTest.cpp index 73a9651..cb9833f 100644 --- a/src/test/InputTest.cpp +++ b/src/test/InputTest.cpp @@ -1,13 +1,13 @@ #include <gtest/gtest.h> #define protected public #define private public -#include "manager/EventManager.h" -#include "manager/ComponentManager.h" #include "api/KeyCodes.h" +#include "manager/ComponentManager.h" +#include "manager/EventManager.h" +#include "manager/Mediator.h" #include "system/InputSystem.h" #include <SDL2/SDL.h> #include <SDL2/SDL_keycode.h> -#include "manager/Mediator.h" #include <crepe/api/Button.h> #include <crepe/api/Camera.h> #include <crepe/api/GameObject.h> @@ -24,17 +24,18 @@ class InputTest : public ::testing::Test { public: Mediator mediator; ComponentManager mgr{mediator}; - + InputSystem input_system{mediator}; EventManager & event_manager = EventManager::get_instance(); //GameObject camera; protected: - void SetUp() override { + void SetUp() override { mediator.event_manager = event_manager; mediator.component_manager = mgr; - event_manager.clear(); } + event_manager.clear(); + } void simulate_mouse_click(int mouse_x, int mouse_y, Uint8 mouse_button) { SDL_Event event; |