X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fapp%2FIntervalTimer.hpp;fp=src%2Fapp%2FIntervalTimer.hpp;h=bcf1baef29e290fafbe90079d4daabc05052914b;hb=3f35e70a6b66daf2ffd59590e98e2dd11e6eaabb;hp=0d6790be20850ebfb9276fc62f88b09408793917;hpb=50f35affb16c78bd3d0b420f5ba37d74fcac391f;p=blank.git diff --git a/src/app/IntervalTimer.hpp b/src/app/IntervalTimer.hpp index 0d6790b..bcf1bae 100644 --- a/src/app/IntervalTimer.hpp +++ b/src/app/IntervalTimer.hpp @@ -23,6 +23,9 @@ public: value = 0; speed = 0; } + void Reset() noexcept { + value = 0; + } bool Running() const noexcept { return speed != 0; @@ -31,6 +34,9 @@ public: bool Hit() const noexcept { return Running() && value % intv < last_dt; } + bool HitOnce() const noexcept { + return value >= intv; + } int Elapsed() const noexcept { return value; }