aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/cursor.hpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-05-23 18:12:39 +0200
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:59 +0200
commit18e1db1fb8692752f64d3912c3b5ff1818be9028 (patch)
tree38ccd9b4f29e5b2fa0fc07f84b425aa80378301a /src/interfaces/cursor.hpp
parent65ca89da7933b5927e31ca6f29f28a24b2838ebe (diff)
refactor: replace last subscriber patterned code
Diffstat (limited to 'src/interfaces/cursor.hpp')
-rw-r--r--src/interfaces/cursor.hpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/interfaces/cursor.hpp b/src/interfaces/cursor.hpp
index 053ff40..63aae41 100644
--- a/src/interfaces/cursor.hpp
+++ b/src/interfaces/cursor.hpp
@@ -1,8 +1,5 @@
#pragma once
-#include "interfaces/publisher.hpp"
-#include "interfaces/subscriber.hpp"
-
#include "engine/data/vector2.hpp"
#include <memory>
@@ -13,19 +10,18 @@ enum CursorEvent
};
// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions)
-class ICursorController : public IPublisher<CursorEvent, Vector2>
+class ICursorController
{
public:
using Event = CursorEvent;
using Context = Vector2;
- using Subscriber = std::shared_ptr<ISubscriber<Context>>;
- ~ICursorController() noexcept override = default;
+ virtual ~ICursorController() noexcept = default;
virtual void move(const Vector2 &direction, const uint32_t &amount) noexcept = 0;
// NOLINTNEXTLINE(google-default-arguments)
- virtual void move_to(const Vector2 &position, bool silent = false) noexcept = 0;
+ virtual void move_to(const Vector2 &position) noexcept = 0;
[[nodiscard]] virtual auto where() const noexcept -> Vector2 = 0;
@@ -34,10 +30,4 @@ public:
virtual void hide() noexcept = 0;
virtual void show() noexcept = 0;
-
- void
- subscribe(const Event &event, const Subscriber &subscriber) noexcept override = 0;
-
- void notify_subscribers(const Event &event, const Context &context)
- const noexcept override = 0;
};