From b74611d2b20fc071b8a699f2ce25e61f60118d6e Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 22 May 2022 23:13:29 +0200 Subject: refactor: improve input handling & remove commands --- src/commands/move_cursor.cpp | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 src/commands/move_cursor.cpp (limited to 'src/commands/move_cursor.cpp') diff --git a/src/commands/move_cursor.cpp b/src/commands/move_cursor.cpp deleted file mode 100644 index 6bd8eda..0000000 --- a/src/commands/move_cursor.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include "move_cursor.hpp" - -MoveCursorCommand::MoveCursorCommand( - const Vector2 &direction, - const std::shared_ptr &cursor_controller, - const std::shared_ptr &scene) noexcept - : _direction(direction), _cursor_controller(cursor_controller), _scene(scene) - -{ -} - -void MoveCursorCommand::execute() noexcept -{ - constexpr int32_t amount = 1; - - const auto new_position = - _cursor_controller->where().to_direction(_direction, amount); - - const auto scene_size = _scene->size(); - - if (scene_size.validate_coords(new_position) != CoordsValidation::VALID) - { - return; - } - - _cursor_controller->move_to(new_position); -} -- cgit v1.2.3-18-g5258