PrimeWorldEditor/Resource/factory/CTemplateLoader.h

36 lines
1.2 KiB
C
Raw Normal View History

#ifndef CTEMPLATELOADER_H
#define CTEMPLATELOADER_H
#include "../script/CMasterTemplate.h"
#include "../script/CScriptTemplate.h"
#include <tinyxml2.h>
class CTemplateLoader
{
CMasterTemplate *mpMaster;
std::string mTemplatesDir;
std::string mMasterDir;
// Constructor
CTemplateLoader(const std::string& templatesDir) : mTemplatesDir(templatesDir) {}
// Load Property
2015-10-25 23:43:11 +00:00
void LoadBitFlags(tinyxml2::XMLElement *pElem, CBitfieldTemplate *pTemp, const std::string& templateName);
2015-10-19 10:35:05 +00:00
void LoadEnumerators(tinyxml2::XMLElement *pElem, CEnumTemplate *pTemp, const std::string& templateName);
void LoadStructProperties(tinyxml2::XMLElement *pElem, CStructTemplate *pTemp, const std::string& templateName);
CPropertyTemplate* LoadPropertyTemplate(tinyxml2::XMLElement *pElem, const std::string& templateName);
// Load Script Object
CScriptTemplate* LoadScriptTemplate(tinyxml2::XMLDocument *pDoc, const std::string& templateName, u32 objectID);
// Load Master
void LoadMasterTemplate(tinyxml2::XMLDocument *pDoc);
void LoadPropertyList(tinyxml2::XMLDocument *pDoc, const std::string& listName);
CMasterTemplate* LoadGame(tinyxml2::XMLNode *pNode);
public:
static void LoadGameList();
};
#endif // CTEMPLATELOADER_H