]> git.localhorst.tv Git - blank.git/blobdiff - src/timer.hpp
some code reorganization
[blank.git] / src / timer.hpp
diff --git a/src/timer.hpp b/src/timer.hpp
deleted file mode 100644 (file)
index c5445b2..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#ifndef BLANK_TIMER_HPP
-#define BLANK_TIMER_HPP
-
-
-namespace blank {
-
-class IntervalTimer {
-
-public:
-       explicit IntervalTimer(int interval_ms) noexcept
-       : intv(interval_ms) { }
-
-       void Start() noexcept {
-               speed = 1;
-       }
-       void Stop() noexcept {
-               value = 0;
-               speed = 0;
-       }
-
-       bool Running() const noexcept {
-               return speed != 0;
-       }
-       bool Hit() const noexcept {
-               return Running() && value % intv < last_dt;
-       }
-       int Elapsed() const noexcept {
-               return value;
-       }
-       int Iteration() const noexcept {
-               return value / intv;
-       }
-
-       void Update(int dt) noexcept {
-               value += dt * speed;
-               last_dt = dt;
-       }
-
-private:
-       int intv;
-       int value = 0;
-       int speed = 0;
-       int last_dt = 0;
-
-};
-
-}
-
-#endif