]> git.localhorst.tv Git - l2e.git/blob - src/graphics/ComplexAnimation.h
removed stupid file headers that eclipse put in
[l2e.git] / src / graphics / ComplexAnimation.h
1 #ifndef GRAPHICS_COMPLEXANIMATION_H_
2 #define GRAPHICS_COMPLEXANIMATION_H_
3
4 #include "Animation.h"
5
6 namespace graphics {
7
8 class ComplexAnimation
9 : public Animation {
10
11 public:
12         static const int TYPE_ID = 402;
13
14 public:
15         ComplexAnimation() : frames(0), numFrames(0) { }
16         ComplexAnimation(const Sprite *sprite, int frameTime, bool repeat = false)
17         : Animation(sprite, frameTime, repeat), frames(0), numFrames(0) { }
18
19 public:
20         struct FrameProp {
21                 static const int TYPE_ID = 403;
22                 FrameProp() : col(0), row(0) { }
23                 FrameProp(int col, int row, const geometry::Vector<int> &disposition)
24                 : col(col), row(row), disposition(disposition) {}
25                 int col;
26                 int row;
27                 geometry::Vector<int> disposition;
28         };
29         void SetFrames(const FrameProp *f, int num) { frames = f; numFrames = num; }
30
31         static void CreateTypeDescription();
32         static void Construct(void *);
33
34 protected:
35         virtual int NumFrames() const { return numFrames; };
36         virtual int Col(int frame) const { return frames[frame].col; }
37         virtual int Row(int frame) const { return frames[frame].row; }
38         virtual geometry::Vector<int> Offset(int frame) const { return frames[frame].disposition; }
39
40 private:
41         const FrameProp *frames;
42         int numFrames;
43
44 };
45
46 }
47
48 #endif /* GRAPHICS_COMPLEXANIMATION_H_ */