4 * Created on: Aug 12, 2012
8 #ifndef GRAPHICS_COMPLEXANIMATION_H_
9 #define GRAPHICS_COMPLEXANIMATION_H_
11 #include "Animation.h"
15 class ComplexAnimation
19 ComplexAnimation() : frames(0), numFrames(0) { }
20 ComplexAnimation(const Sprite *sprite, int frameTime, bool repeat = false)
21 : Animation(sprite, frameTime, repeat), frames(0), numFrames(0) { }
25 FrameProp() : col(0), row(0) { }
26 FrameProp(int col, int row, const geometry::Vector<int> &disposition)
27 : col(col), row(row), disposition(disposition) {}
30 geometry::Vector<int> disposition;
32 void SetFrames(const FrameProp *f, int num) { frames = f; numFrames = num; }
34 static void CreateTypeDescription();
37 virtual int NumFrames() const { return numFrames; };
38 virtual int Col(int frame) const { return frames[frame].col; }
39 virtual int Row(int frame) const { return frames[frame].row; }
40 virtual geometry::Vector<int> Offset(int frame) const { return frames[frame].disposition; }
43 const FrameProp *frames;
50 #endif /* GRAPHICS_COMPLEXANIMATION_H_ */