aboutsummaryrefslogtreecommitdiff
path: root/src/commands
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-05-22 17:05:00 +0200
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:59 +0200
commit7de921836587cdc359c2c4b84ed6446ada16c008 (patch)
treec4ec20b4769817c41ce7d939956da297bf787597 /src/commands
parent723ea6535b4c4e5605e5592137a898d6ffa458c1 (diff)
refactor: remove window class
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/move_cursor.cpp8
-rw-r--r--src/commands/move_cursor.hpp6
2 files changed, 7 insertions, 7 deletions
diff --git a/src/commands/move_cursor.cpp b/src/commands/move_cursor.cpp
index 12a247d..6bd8eda 100644
--- a/src/commands/move_cursor.cpp
+++ b/src/commands/move_cursor.cpp
@@ -3,8 +3,8 @@
MoveCursorCommand::MoveCursorCommand(
const Vector2 &direction,
const std::shared_ptr<ICursorController> &cursor_controller,
- const std::shared_ptr<IWindow> &window) noexcept
- : _direction(direction), _cursor_controller(cursor_controller), _window(window)
+ const std::shared_ptr<IScene> &scene) noexcept
+ : _direction(direction), _cursor_controller(cursor_controller), _scene(scene)
{
}
@@ -16,9 +16,9 @@ void MoveCursorCommand::execute() noexcept
const auto new_position =
_cursor_controller->where().to_direction(_direction, amount);
- const auto window_size = _window->size();
+ const auto scene_size = _scene->size();
- if (window_size.validate_coords(new_position) != CoordsValidation::VALID)
+ if (scene_size.validate_coords(new_position) != CoordsValidation::VALID)
{
return;
}
diff --git a/src/commands/move_cursor.hpp b/src/commands/move_cursor.hpp
index aab228c..dc08c64 100644
--- a/src/commands/move_cursor.hpp
+++ b/src/commands/move_cursor.hpp
@@ -2,7 +2,7 @@
#include "interfaces/command.hpp"
#include "interfaces/cursor.hpp"
-#include "interfaces/window.hpp"
+#include "interfaces/scene.hpp"
#include "engine/data/vector2.hpp"
@@ -14,12 +14,12 @@ public:
MoveCursorCommand(
const Vector2 &direction,
const std::shared_ptr<ICursorController> &cursor_controller,
- const std::shared_ptr<IWindow> &window) noexcept;
+ const std::shared_ptr<IScene> &scene) noexcept;
void execute() noexcept override;
private:
Vector2 _direction;
const std::shared_ptr<ICursorController> &_cursor_controller;
- const std::shared_ptr<IWindow> &_window;
+ const std::shared_ptr<IScene> &_scene;
};