From: Daniel Karbach Date: Thu, 7 Feb 2013 06:52:52 +0000 (+0100) Subject: added getters for interval timer information X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=c33724dc441c5b21a4eb84aa0105c95e82a66adc;p=l2e.git added getters for interval timer information --- diff --git a/src/app/Timer.h b/src/app/Timer.h index a66341a..d744fe0 100644 --- a/src/app/Timer.h +++ b/src/app/Timer.h @@ -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();