aboutsummaryrefslogtreecommitdiff
path: root/src/engine/user/cursor.cpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-05-15 19:57:02 +0200
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:59 +0200
commit019337908e37ffee9b624b313e9d7f885bff9781 (patch)
tree7f8ba5e8b12fff7723b1af2317c3fba52c0c7011 /src/engine/user/cursor.cpp
parent741a6008e806abb8e5aaa8f8fb91827fa97ece9d (diff)
style: change braced list & bracket style
Diffstat (limited to 'src/engine/user/cursor.cpp')
-rw-r--r--src/engine/user/cursor.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/engine/user/cursor.cpp b/src/engine/user/cursor.cpp
index 71f02da..945433b 100644
--- a/src/engine/user/cursor.cpp
+++ b/src/engine/user/cursor.cpp
@@ -5,7 +5,7 @@
#include <cstdlib>
#include <iostream>
-CursorController::CursorController() noexcept : _position({ .x = 0, .y = 0 }) {}
+CursorController::CursorController() noexcept : _position({.x = 0, .y = 0}) {}
void CursorController::move(const Vector2 &direction, const uint32_t &amount) noexcept
{
@@ -14,8 +14,7 @@ void CursorController::move(const Vector2 &direction, const uint32_t &amount) no
fmt::print(
fmt::runtime(direction_format.data()),
fmt::arg("esc", ESC),
- fmt::arg("amount", amount)
- );
+ fmt::arg("amount", amount));
std::cout.flush();
_position = _position.to_direction(direction, static_cast<Vector2::Value>(amount));
@@ -29,8 +28,7 @@ void CursorController::move_to(const Vector2 &position, bool silent) noexcept
MOVE_CURSOR_TO,
fmt::arg("esc", ESC),
fmt::arg("row", position.get_y()),
- fmt::arg("column", position.get_x())
- );
+ fmt::arg("column", position.get_x()));
std::cout.flush();
_position = position;
@@ -75,12 +73,11 @@ void CursorController::show() noexcept
void CursorController::subscribe(
const Event &event,
- const Subscriber &subscriber
-) noexcept
+ const Subscriber &subscriber) noexcept
{
if (_subscribers.count(event) == 0)
{
- _subscribers.insert({ event, std::vector<Subscriber>() });
+ _subscribers.insert({event, std::vector<Subscriber>()});
}
_subscribers.at(event).push_back(subscriber);