From d2a76bd8cfd883070259bf572a9f723a37c0d96e Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 28 Jun 2022 19:22:06 +0200 Subject: refactor: improve includes with iwyu --- src/engine/user/cursor.cpp | 5 ++--- src/engine/user/cursor.hpp | 16 +++++++++------- src/engine/user/input.cpp | 5 ++--- src/engine/user/input.hpp | 3 +-- 4 files changed, 14 insertions(+), 15 deletions(-) (limited to 'src/engine/user') diff --git a/src/engine/user/cursor.cpp b/src/engine/user/cursor.cpp index a372ca7..5cd74a6 100644 --- a/src/engine/user/cursor.cpp +++ b/src/engine/user/cursor.cpp @@ -1,10 +1,9 @@ #include "cursor.hpp" -#include "engine/escape.hpp" - -#include #include +#include "engine/escape.hpp" + CursorController::CursorController() noexcept : _position({.x = 0, .y = 0}), _bounds({0, 0}) { diff --git a/src/engine/user/cursor.hpp b/src/engine/user/cursor.hpp index 06c6b88..ff7e89f 100644 --- a/src/engine/user/cursor.hpp +++ b/src/engine/user/cursor.hpp @@ -2,16 +2,16 @@ #include "interfaces/cursor.hpp" -#include "engine/data/bounds.hpp" -#include "engine/data/vector2.hpp" - +#include #include -#include - #include #include #include #include +#include + +#include "engine/data/bounds.hpp" +#include "engine/data/vector2.hpp" constexpr std::string_view MOVE_CURSOR_UP = "{esc}[{amount}A"; constexpr std::string_view MOVE_CURSOR_DOWN = "{esc}[{amount}B"; @@ -39,8 +39,10 @@ class CursorController : public ICursorController, public: CursorController() noexcept; - void move(const Vector2 &direction, const std::uint32_t &amount, bool flush_cout) noexcept - override; + void move( + const Vector2 &direction, + const std::uint32_t &amount, + bool flush_cout) noexcept override; void move_to(const Vector2 &position, bool flush_cout) noexcept override; diff --git a/src/engine/user/input.cpp b/src/engine/user/input.cpp index f0ffbe5..505a0fa 100644 --- a/src/engine/user/input.cpp +++ b/src/engine/user/input.cpp @@ -1,11 +1,10 @@ #include "input.hpp" -#include "engine/keycodes.hpp" - #include -#include #include +#include "engine/keycodes.hpp" + const std::unordered_map special_keys_map = { {'A', keycodes::UP_ARROW}, {'B', keycodes::DOWN_ARROW}, diff --git a/src/engine/user/input.hpp b/src/engine/user/input.hpp index 12c27ee..9e8196d 100644 --- a/src/engine/user/input.hpp +++ b/src/engine/user/input.hpp @@ -2,11 +2,10 @@ #include "interfaces/input.hpp" -#include - #include #include #include +#include class UserInputObserver : public IUserInputObserver, -- cgit v1.2.3-18-g5258