From 9b01fa8ff25eae054815ced5f5371cd82fe0a5fe Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 20 Mar 2022 20:58:16 +0100 Subject: refactor: remove strings header file --- src/game/cursor_listener.cpp | 6 +----- src/game/game.cpp | 5 +---- src/strings.hpp | 5 ----- 3 files changed, 2 insertions(+), 14 deletions(-) delete mode 100644 src/strings.hpp 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 #include @@ -12,7 +10,5 @@ CursorListener::CursorListener(std::shared_ptr 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 #include @@ -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 - -constexpr fmt::string_view STATUS_BAR_COORDINATES = "X: {x} Y {y}"; -- cgit v1.2.3-18-g5258