4 * Created on: Aug 12, 2012
8 #ifndef GRAPHICS_COMPLEXANIMATION_H_
9 #define GRAPHICS_COMPLEXANIMATION_H_
11 #include "Animation.h"
15 class ComplexAnimation
19 static const int TYPE_ID = 402;
22 ComplexAnimation() : frames(0), numFrames(0) { }
23 ComplexAnimation(const Sprite *sprite, int frameTime, bool repeat = false)
24 : Animation(sprite, frameTime, repeat), frames(0), numFrames(0) { }
28 static const int TYPE_ID = 403;
29 FrameProp() : col(0), row(0) { }
30 FrameProp(int col, int row, const geometry::Vector<int> &disposition)
31 : col(col), row(row), disposition(disposition) {}
34 geometry::Vector<int> disposition;
36 void SetFrames(const FrameProp *f, int num) { frames = f; numFrames = num; }
38 static void CreateTypeDescription();
39 static void Construct(void *);
42 virtual int NumFrames() const { return numFrames; };
43 virtual int Col(int frame) const { return frames[frame].col; }
44 virtual int Row(int frame) const { return frames[frame].row; }
45 virtual geometry::Vector<int> Offset(int frame) const { return frames[frame].disposition; }
48 const FrameProp *frames;
55 #endif /* GRAPHICS_COMPLEXANIMATION_H_ */