diff options
| author | HampusM <hampus@hampusmat.com> | 2022-03-20 13:17:16 +0100 | 
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2022-06-13 17:56:56 +0200 | 
| commit | 78f5d8cf644383adf20933ad64c160c07c2c54fb (patch) | |
| tree | 2a348d90f8f150665c379bf2f3741731999dd679 /src/input_actions.cpp | |
| parent | b6061eff99907495de282f611e8389e6468a1fb0 (diff) | |
refactor: improve input configuring structure
Diffstat (limited to 'src/input_actions.cpp')
| -rw-r--r-- | src/input_actions.cpp | 42 | 
1 files changed, 0 insertions, 42 deletions
diff --git a/src/input_actions.cpp b/src/input_actions.cpp deleted file mode 100644 index fa41bdd..0000000 --- a/src/input_actions.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include "input_actions.hpp" - -#include "strings.hpp" - -#include <fmt/core.h> - -namespace InputActions -{ - -void exit_success() noexcept -{ -	exit(EXIT_SUCCESS); -} - -Callback move_cursor(const Vector2 &direction, -					 const std::shared_ptr<ICursorController> &cursor_controller, -					 const std::shared_ptr<IScene> &scene, -					 const std::shared_ptr<IWindow> &window) noexcept -{ -	return [direction, cursor_controller, scene, window]() -	{ -		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); - -		scene->write_status(fmt::format(STATUS_BAR_COORDINATES, -										fmt::arg("x", new_position.get_x()), -										fmt::arg("y", new_position.get_y()))); -	}; -} - -} // namespace InputActions  | 
