#pragma once #include "DI/auto_wirable.hpp" #include "interfaces/direction.hpp" #include "engine/data/vector2.hpp" #include "fmt/core.h" #include #include #include constexpr std::string_view MOVE_CURSOR_UP = "{esc}[{amount}A"; constexpr std::string_view MOVE_CURSOR_DOWN = "{esc}[{amount}B"; constexpr std::string_view MOVE_CURSOR_LEFT = "{esc}[{amount}D"; constexpr std::string_view MOVE_CURSOR_RIGHT = "{esc}[{amount}C"; constexpr fmt::string_view MOVE_CURSOR_TO = "{esc}[{row};{column}H"; constexpr fmt::string_view REQUEST_CURSOR_POSITION = "{esc}[6n"; constexpr fmt::string_view CURSOR_VISIBLE = "{esc}[?25h"; constexpr fmt::string_view CURSOR_INVISIBLE = "{esc}[?25l"; class CursorController : public AutoWirable { public: CursorController() = default; template constexpr void move(const uint32_t &amount) const; static void move_to(const Vector2 &pos); static void hide(); static void show(); [[nodiscard]] static Vector2 where(); }; #include "cursor.tpp"