00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef MAPREADER_H
00023 #define MAPREADER_H
00024
00025 #include <libxml/tree.h>
00026
00027 class Map;
00028 class Properties;
00029 class Tileset;
00030
00034 class MapReader
00035 {
00036 public:
00040 static Map *readMap(const std::string &filename);
00041
00046 static Map *readMap(xmlNodePtr node, const std::string &path);
00047
00048 private:
00056 static void readProperties(xmlNodePtr node, Properties* props);
00057
00061 static void readLayer(xmlNodePtr node, Map *map);
00062
00066 static Tileset *readTileset(xmlNodePtr node, const std::string &path,
00067 Map *map);
00068
00072 static int getProperty(xmlNodePtr node, const char* name, int def);
00073 };
00074
00075 #endif