-public:
- void Start(app::State &ctrl) {
- timer = ctrl.GraphicsTimers().StartInterval(frameTime);
- }
- void Start(app::Application &ctrl) {
- timer = ctrl.GlobalTimers().StartInterval(frameTime);
- }
- void Stop() {
- timer = app::Timer<Uint32>();
- }
- bool Running() const {
- return timer.Running() && (repeat || timer.Iteration() < numFrames);
- }
- void Draw(SDL_Surface *dest, geometry::Point<int> position) {
- sprite->Draw(dest, position, col, Running() ? row + (timer.Iteration() % numFrames) : row);
- }
- void DrawCenterBottom(SDL_Surface *dest, geometry::Point<int> position) const {
- sprite->DrawCenterBottom(dest, position, col, Running() ? row + (timer.Iteration() % numFrames) : row);
- }
+protected:
+ virtual int NumFrames() const { return numFrames; };
+ virtual int Col(int frame) const { return col; }
+ virtual int Row(int frame) const { return row + frame; }