#include "move_cursor.hpp" MoveCursorCommand::MoveCursorCommand( const Vector2 &direction, const std::shared_ptr &cursor_controller, const std::shared_ptr &window) noexcept : _direction(direction), _cursor_controller(cursor_controller), _window(window) { } void MoveCursorCommand::execute() noexcept { constexpr int32_t amount = 1; const auto new_position = _cursor_controller->where().to_direction(_direction, amount); const auto window_size = _window->size(); if (window_size.validate_coords(new_position) != CoordsValidation::VALID) { return; } _cursor_controller->move_to(new_position); }