1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Improve serialization of IDs from mods, so they are resolved correctly after all mods are loaded.

This commit is contained in:
Tomasz Zieliński
2023-07-05 20:53:00 +02:00
parent 50bed178ca
commit 9f2bfbc1d8
5 changed files with 53 additions and 38 deletions

View File

@@ -459,11 +459,19 @@ class FactionID : public BaseForID<FactionID, int32_t>
DLL_LINKAGE static const FactionID CONFLUX;
DLL_LINKAGE static const FactionID NEUTRAL;
///json serialization helpers
static si32 decode(const std::string & identifier);
static si32 decode(const std::string& identifier);
static std::string encode(const si32 index);
static std::string scope();
};
class TerrainID
{
//Dummy class used only for serialization
public:
static si32 decode(const std::string & identifier);
static std::string encode(const si32 index);
static std::string scope();
};
class BuildingID
{