Debian Codegraph @

src/level/View.h

raw
1 #ifndef HEADER_VIEW_H
2 #define HEADER_VIEW_H
3
4 class Cube;
5 class PhaseLocker;
6 class Decor;
7
8 #include "Drawable.h"
9 #include "ModelList.h"
10 #include "V2.h"
11
12 /**
13 * View for model.
14 */
15 class View : public Drawable {
16 public:
17 static const int SCALE = 15;
18 private:
19 typedef std::vector<Decor*> t_decors;
20 t_decors m_decors;
21 ModelList m_models;
22 int m_animShift;
23 int m_shiftSize;
24 SDL_Surface *m_screen;
25 V2 m_screenShift;
26 private:
27 void computeShiftSize(int phases);
28 void drawDecors();
29 public:
30 View(const ModelList &models);
31 virtual ~View();
32 void setScreenShift(const V2 &shift) { m_screenShift = shift; }
33 void noteNewRound(int phases);
34
35 void drawModel(Cube *model);
36 virtual void drawOn(SDL_Surface *screen);
37
38 V2 getScreenPos(const Cube *model) const;
39 V2 getFieldPos(const V2 &cursor) const;
40 void addDecor(Decor *new_decor) { m_decors.push_back(new_decor); }
41 void removeDecors();
42 };
43
44 #endif