mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
Redone RMG template serialization using JSON serializer, added tests
This commit is contained in:
@@ -10,12 +10,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CRmgTemplate.h"
|
||||
#include "../IHandlerBase.h"
|
||||
|
||||
class JsonNode;
|
||||
|
||||
typedef std::vector<JsonNode> JsonVector;
|
||||
class CRmgTemplate;
|
||||
|
||||
/// The CJsonRmgTemplateLoader loads templates from a JSON file.
|
||||
class DLL_LINKAGE CRmgTemplateStorage : public IHandlerBase
|
||||
@@ -34,14 +32,6 @@ public:
|
||||
virtual void loadObject(std::string scope, std::string name, const JsonNode & data, size_t index) override;
|
||||
|
||||
private:
|
||||
CRmgTemplate::CSize parseMapTemplateSize(const std::string & text) const;
|
||||
rmg::ZoneOptions::CTownInfo parseTemplateZoneTowns(const JsonNode & node) const;
|
||||
ETemplateZoneType::ETemplateZoneType parseZoneType(const std::string & type) const;
|
||||
std::set<TFaction> parseTownTypes(const JsonVector & townTypesVector, const std::set<TFaction> & defaultTownTypes) const;
|
||||
std::set<ETerrainType> parseTerrainTypes(const JsonVector & terTypeStrings, const std::set<ETerrainType> & defaultTerrainTypes) const;
|
||||
CRmgTemplate::CPlayerCountRange parsePlayers(const std::string & players) const;
|
||||
|
||||
protected:
|
||||
std::map<std::string, CRmgTemplate *> templates;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user