]> git.localhorst.tv Git - l2e.git/blobdiff - src/app/Timer.h
added getters for interval timer information
[l2e.git] / src / app / Timer.h
index a66341ac7b962b3ae358834d46d3f226db9fb953..d744fe09966cc203e76982695a1824e05946ed14 100644 (file)
@@ -68,6 +68,18 @@ public:
        Time Remaining() const {
                return data ? (data->target - data->time) : Time();
        }
+       /// Time from start to hit.
+       Time TargetTime() const {
+               return data ? data->target : Time();
+       }
+       /// Get the elapsed time since the timer started or last hit.
+       Time IterationElapsed() const {
+               return data ? data->time % data->target : Time();
+       }
+       /// Get the remaining time in this iteration.
+       Time IterationRemaining() const {
+               return TargetTime() - IterationElapsed();
+       }
        /// Get the iteration index for interval timers.
        int Iteration() const {
                return (data && data->target > Time()) ? std::floor(data->time / data->target) : Time();