2014-11-21 14:43:27 +00:00
|
|
|
#ifndef CONVERTER_INCLUDED
|
|
|
|
#define CONVERTER_INCLUDED
|
2014-11-25 12:51:25 +00:00
|
|
|
|
2014-11-21 14:43:27 +00:00
|
|
|
#include <vector>
|
2014-11-25 12:51:25 +00:00
|
|
|
#include <string>
|
2014-11-24 12:03:55 +00:00
|
|
|
#include "tinyxml2.hh"
|
2014-11-21 14:43:27 +00:00
|
|
|
|
2014-11-25 12:51:25 +00:00
|
|
|
using namespace tinyxml2;
|
2014-11-21 14:43:27 +00:00
|
|
|
class Converter {
|
|
|
|
public:
|
2014-11-25 12:51:25 +00:00
|
|
|
Converter(std::string level);
|
2014-11-21 14:43:27 +00:00
|
|
|
Converter();
|
|
|
|
~Converter();
|
2014-12-08 12:33:38 +00:00
|
|
|
void updateComposition(int idG, int idB, float posX, float posZ); //updates the position of a composition
|
2014-12-08 13:19:23 +00:00
|
|
|
std::vector<unsigned int> newComposition(int type, float posX, float posZ);//creates a new composition and returns its ID
|
2014-12-08 12:33:38 +00:00
|
|
|
void deleteComposition(int idG, int idB);
|
2014-12-02 12:37:31 +00:00
|
|
|
void save(); //writes the xml to file
|
|
|
|
std::vector<unsigned int> getNextID(); //returns the next unused ID
|
2014-11-21 14:43:27 +00:00
|
|
|
|
|
|
|
private:
|
2014-12-08 13:19:23 +00:00
|
|
|
|
2014-12-01 13:09:55 +00:00
|
|
|
std::vector<unsigned int> nextID;
|
2014-12-08 13:10:08 +00:00
|
|
|
void errorCheck(XMLError error);
|
2014-11-25 12:51:25 +00:00
|
|
|
std::string xmlFile;
|
|
|
|
XMLDocument* doc = new XMLDocument();
|
2014-11-28 16:05:49 +00:00
|
|
|
XMLDocument* compositions = new XMLDocument();
|
2014-11-21 14:43:27 +00:00
|
|
|
};
|
2014-11-25 12:51:25 +00:00
|
|
|
|
2014-11-21 14:43:27 +00:00
|
|
|
#endif
|