diff options
author | HampusM <hampus@hampusmat.com> | 2022-03-20 20:58:16 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-13 17:56:57 +0200 |
commit | 9b01fa8ff25eae054815ced5f5371cd82fe0a5fe (patch) | |
tree | 91073b9238f94391cc3b957d694abfe54c4e4eb9 | |
parent | 1972939ebde39a3e90a50b021b2322d028f344de (diff) |
refactor: remove strings header file
-rw-r--r-- | src/game/cursor_listener.cpp | 6 | ||||
-rw-r--r-- | src/game/game.cpp | 5 | ||||
-rw-r--r-- | src/strings.hpp | 5 |
3 files changed, 2 insertions, 14 deletions
diff --git a/src/game/cursor_listener.cpp b/src/game/cursor_listener.cpp index c13ce44..c815f08 100644 --- a/src/game/cursor_listener.cpp +++ b/src/game/cursor_listener.cpp @@ -1,7 +1,5 @@ #include "cursor_listener.hpp" -#include "strings.hpp" - #include <fmt/core.h> #include <utility> @@ -12,7 +10,5 @@ CursorListener::CursorListener(std::shared_ptr<IScene> scene) noexcept void CursorListener::update(const Vector2 &context) noexcept { - _scene->write_status(fmt::format(STATUS_BAR_COORDINATES, - fmt::arg("x", context.get_x()), - fmt::arg("y", context.get_y()))); + _scene->write_status(fmt::format("X: {} Y {}", context.get_x(), context.get_y())); } diff --git a/src/game/game.cpp b/src/game/game.cpp index 055e212..f788d15 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -4,7 +4,6 @@ #include "commands/move_cursor.hpp" #include "commands/quit.hpp" #include "game/cursor_listener.hpp" -#include "strings.hpp" #include <fmt/core.h> #include <iostream> @@ -29,9 +28,7 @@ void Game::on_start() noexcept _cursor_controller->move_to(center_position); - _scene->write_status(fmt::format(STATUS_BAR_COORDINATES, - fmt::arg("x", center_position.get_x()), - fmt::arg("y", center_position.get_y()))); + cursor_listener->update(center_position); } void Game::on_exit() const noexcept diff --git a/src/strings.hpp b/src/strings.hpp deleted file mode 100644 index 3678c57..0000000 --- a/src/strings.hpp +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include <fmt/core.h> - -constexpr fmt::string_view STATUS_BAR_COORDINATES = "X: {x} Y {y}"; |