From 72362f77321c32b15811014b81165a38ebee9d61 Mon Sep 17 00:00:00 2001 From: Vladimir <68227685+NoPressF@users.noreply.github.com> Date: Sun, 27 Oct 2024 11:14:28 +0100 Subject: [PATCH 1/2] Added timer's virtual functions (set interval & pause/resume) --- include/Server/Components/Timers/timers.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/Server/Components/Timers/timers.hpp b/include/Server/Components/Timers/timers.hpp index c3c76e4..27b22b4 100644 --- a/include/Server/Components/Timers/timers.hpp +++ b/include/Server/Components/Timers/timers.hpp @@ -12,6 +12,9 @@ struct ITimer : public IExtensible /// Get whether the timer is running or has been killed virtual bool running() const = 0; + /// Get the timer paused state + virtual bool paused() const = 0; + /// Get the remaining time until time out virtual Milliseconds remaining() const = 0; @@ -21,10 +24,16 @@ struct ITimer : public IExtensible /// Get the timer's interval virtual Milliseconds interval() const = 0; + /// Set the timer's interval + virtual void setInterval(Milliseconds interval) = 0; + /// Mark the timer as being called now. Returns `true` when there are more /// calls to make after this one. virtual bool trigger() = 0; + /// Toggle the timer paused state + virtual void togglePause(bool paused) = 0; + /// Immediately kill the timer virtual void kill() = 0; From c69b93cbe3c1532e1998cc091794d66ed636be5a Mon Sep 17 00:00:00 2001 From: Vladimir <68227685+NoPressF@users.noreply.github.com> Date: Tue, 20 May 2025 22:49:07 +0200 Subject: [PATCH 2/2] cleanup some code --- include/Server/Components/Timers/timers.hpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/include/Server/Components/Timers/timers.hpp b/include/Server/Components/Timers/timers.hpp index 27b22b4..6ab5ebe 100644 --- a/include/Server/Components/Timers/timers.hpp +++ b/include/Server/Components/Timers/timers.hpp @@ -12,9 +12,6 @@ struct ITimer : public IExtensible /// Get whether the timer is running or has been killed virtual bool running() const = 0; - /// Get the timer paused state - virtual bool paused() const = 0; - /// Get the remaining time until time out virtual Milliseconds remaining() const = 0; @@ -24,21 +21,24 @@ struct ITimer : public IExtensible /// Get the timer's interval virtual Milliseconds interval() const = 0; - /// Set the timer's interval - virtual void setInterval(Milliseconds interval) = 0; - /// Mark the timer as being called now. Returns `true` when there are more /// calls to make after this one. virtual bool trigger() = 0; - /// Toggle the timer paused state - virtual void togglePause(bool paused) = 0; - /// Immediately kill the timer virtual void kill() = 0; /// Get the handler associated with the timer virtual TimerTimeOutHandler* handler() const = 0; + + /// Get the timer paused state + virtual bool paused() const = 0; + + /// Set the timer's interval + virtual void setInterval(Milliseconds interval) = 0; + + /// Toggle the timer paused state + virtual void togglePause(bool paused) = 0; }; struct TimerTimeOutHandler