From 18e1db1fb8692752f64d3912c3b5ff1818be9028 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 23 May 2022 18:12:39 +0200 Subject: refactor: replace last subscriber patterned code --- src/interfaces/cursor.hpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'src/interfaces/cursor.hpp') 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 @@ -13,19 +10,18 @@ enum CursorEvent }; // NOLINTNEXTLINE(cppcoreguidelines-special-member-functions) -class ICursorController : public IPublisher +class ICursorController { public: using Event = CursorEvent; using Context = Vector2; - using Subscriber = std::shared_ptr>; - ~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; }; -- cgit v1.2.3-18-g5258