]> git.localhorst.tv Git - blank.git/blobdiff - src/app/IntervalTimer.hpp
move RandomWalk into new "ai" module
[blank.git] / src / app / IntervalTimer.hpp
index 0d6790be20850ebfb9276fc62f88b09408793917..bcf1baef29e290fafbe90079d4daabc05052914b 100644 (file)
@@ -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;
        }