void Stop() {
timer = app::Timer<Uint32>();
}
+ bool Started() const {
+ return timer.Started();
+ }
bool Running() const {
return timer.Running() && (repeat || timer.Iteration() < NumFrames());
}
+ bool Finished() const {
+ return Started() && !Running();
+ }
+ bool JustFinished() const {
+ return timer.JustHit() && timer.Iteration() == NumFrames();
+ }
+
+ const app::Timer<Uint32> &GetTimer() { return timer; }
void SetColOffset(int offset) { colOffset = offset; }
int ColOffset() const { return colOffset; }
Draw(dest, position + offset);
}
-protected:
int Frame() const { return Running() ? (timer.Iteration() % NumFrames()) : 0; }
+
+protected:
virtual int Col() const = 0;
virtual int Row() const = 0;
virtual int NumFrames() const = 0;