stratgame

view level/src/level.h @ 2:369b51c9e4a8

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 23 May 2012 07:25:43 +0300
parents 86b53f76899f
children 8d95187cb3ee
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);
21 };
23 class LevelMap {
24 private:
25 float scale;
26 img_pixmap img;
27 char *name;
29 void init();
30 void destroy();
32 public:
33 LevelMap();
34 ~LevelMap();
36 LevelMap(const LevelMap &map);
37 LevelMap &operator =(const LevelMap &map);
39 // move constructor/op=
40 LevelMap(LevelMap &&map);
41 LevelMap &operator =(LevelMap &&map);
43 bool load(tinyxml2::XMLElement *xelem);
45 float get_scale() const;
46 const img_pixmap *get_pixmap() const;
47 const char *get_name() const;
48 };
50 #endif // LEVEL_H_