+ const Sprite *GetSprite() const { return sprite; }
+ int FrameTime() const { return frameTime; }
+ bool Repeat() const { return repeat; }
+
+public:
+ void SetSprite(const Sprite *s) { sprite = s; }
+ void SetFrameTime(int t) { frameTime = t; }
+ void SetRepeat(bool r) { repeat = r; }
+
+public:
+ virtual int NumFrames() const = 0;
+ virtual int Col(int frame) const = 0;
+ virtual int Row(int frame) const = 0;
+ virtual geometry::Vector<int> Offset(int frame) const { return geometry::Vector<int>(); }
+
+protected:
+ static void AddFields(loader::TypeDescription &, const Animation &, std::ptrdiff_t offset, int boolId, int numberId, int spriteId);
+
+private:
+ const Sprite *sprite;
+ int frameTime;
+ bool repeat;
+
+};
+
+
+class AnimationRunner {
+
+public:
+ explicit AnimationRunner(const Animation *a = 0, int colOffset = 0, int rowOffset = 0)
+ : animation(a), sprite(0), frameShift(0), colOffset(colOffset), rowOffset(rowOffset) { }
+
+public:
+ bool Valid() const { return animation; }
+ void Clear() { animation = 0; timer = app::Timer<Uint32>(); }
+