00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _INCLUDED_MAPREADER_H
00023 #define _INCLUDED_MAPREADER_H
00024
00025 #include <string>
00026 #include <vector>
00027
00028 #include <libxml/tree.h>
00029
00030 class Map;
00031 class MapComposite;
00032 class Thing;
00033
00037 class MapReader
00038 {
00039 public:
00043 static void readMap(const std::string &filename,
00044 MapComposite *composite);
00045
00046 private:
00051 static Map *readMap(xmlNodePtr node, const std::string &path,
00052 MapComposite *composite,
00053 std::vector<Thing *> &things);
00054
00058 static void readLayer(xmlNodePtr node, Map *map);
00059
00063 static std::string getObjectProperty(xmlNodePtr node,
00064 const std::string &def);
00065
00069 static int getObjectProperty(xmlNodePtr node, int def);
00070
00071 static void setTileWithGid(Map *map, int x, int y, int gid);
00072 };
00073
00074 #endif