stratgame

diff 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 diff
     1.1 --- a/level/src/level.h	Tue May 22 05:02:00 2012 +0300
     1.2 +++ b/level/src/level.h	Wed May 23 07:25:43 2012 +0300
     1.3 @@ -1,11 +1,17 @@
     1.4  #ifndef LEVEL_H_
     1.5  #define LEVEL_H_
     1.6  
     1.7 +#include <string>
     1.8 +#include <map>
     1.9 +#include <imago2.h>
    1.10  #include "tinyxml2.h"
    1.11  
    1.12 +class LevelMap;
    1.13 +
    1.14  class Level {
    1.15  private:
    1.16  	tinyxml2::XMLDocument xml;
    1.17 +	std::map<std::string, LevelMap> levelmaps;
    1.18  
    1.19  public:
    1.20  	Level();
    1.21 @@ -14,9 +20,31 @@
    1.22  	bool load(const char *fname);
    1.23  };
    1.24  
    1.25 -class Map {
    1.26 +class LevelMap {
    1.27 +private:
    1.28 +	float scale;
    1.29 +	img_pixmap img;
    1.30 +	char *name;
    1.31 +
    1.32 +	void init();
    1.33 +	void destroy();
    1.34 +
    1.35  public:
    1.36 -	bool load(tinyxml2::XMLNode *xml);
    1.37 +	LevelMap();
    1.38 +	~LevelMap();
    1.39 +
    1.40 +	LevelMap(const LevelMap &map);
    1.41 +	LevelMap &operator =(const LevelMap &map);
    1.42 +
    1.43 +	// move constructor/op=
    1.44 +	LevelMap(LevelMap &&map);
    1.45 +	LevelMap &operator =(LevelMap &&map);
    1.46 +
    1.47 +	bool load(tinyxml2::XMLElement *xelem);
    1.48 +
    1.49 +	float get_scale() const;
    1.50 +	const img_pixmap *get_pixmap() const;
    1.51 +	const char *get_name() const;
    1.52  };
    1.53  
    1.54  #endif	// LEVEL_H_