stratgame

view level/src/level.h @ 3:8d95187cb3ee

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 23 May 2012 17:10:46 +0300
parents 369b51c9e4a8
children 2e38715de41b
line source
1 #ifndef LEVEL_H_
2 #define LEVEL_H_
4 #include <string>
5 #include <map>
6 #include <imago2.h>
7 #include "tinyxml2.h"
9 class LevelMap;
11 class Level {
12 private:
13 tinyxml2::XMLDocument xml;
14 std::map<std::string, LevelMap> levelmaps;
16 public:
17 Level();
18 ~Level();
20 bool load(const char *fname);
22 void draw() const;
23 };
25 class LevelMap {
26 private:
27 float scale;
28 img_pixmap img;
29 char *name;
31 void init();
32 void destroy();
34 public:
35 LevelMap();
36 ~LevelMap();
38 LevelMap(const LevelMap &map);
39 LevelMap &operator =(const LevelMap &map);
41 // move constructor/op=
42 LevelMap(LevelMap &&map);
43 LevelMap &operator =(LevelMap &&map);
45 bool load(tinyxml2::XMLElement *xelem);
47 float get_scale() const;
48 const img_pixmap *get_pixmap() const;
49 const char *get_name() const;
50 };
52 #endif // LEVEL_H_