mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
* WIP on event condition format
* Hero portrait serialization * Fix town spells serialization * Added support for float exponential part in Json * Added support for int64 in Json * Added basic Hero definitions serialization * Added rumors serialization * Advanced player info serialization. * Added Disposed heroes serialization, (!) not covered with tests yet * Added Local event serialization * Added Pandoras box serialization * Added Seer hut reward serialization * Added CQuest serialization * Added API for map object instance names serialization. * Added random dwelling options serialization * Advanced town options serialization * Advanced hero options serialization * More map format tests * A lot of fixes, cleanup and refactoring
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
#include "../filesystem/CZipLoader.h"
|
||||
#include "../GameConstants.h"
|
||||
|
||||
#include "../serializer/JsonSerializeFormat.h"
|
||||
|
||||
struct TriggeredEvent;
|
||||
struct TerrainTile;
|
||||
struct PlayerInfo;
|
||||
@@ -39,6 +41,8 @@ public:
|
||||
int fileVersionMajor;
|
||||
int fileVersionMinor;
|
||||
protected:
|
||||
friend class MapObjectResolver;
|
||||
std::unique_ptr<IInstanceResolver> mapObjectResolver;
|
||||
|
||||
/** ptr to the map object which gets filled by data from the buffer or written to buffer */
|
||||
CMap * map;
|
||||
@@ -49,6 +53,8 @@ protected:
|
||||
*/
|
||||
CMapHeader * mapHeader;
|
||||
|
||||
CMapFormatJson();
|
||||
|
||||
void serializeAllowedFactions(JsonSerializeFormat & handler, std::set<TFaction> & value);
|
||||
|
||||
///common part of header saving/loading
|
||||
@@ -67,10 +73,6 @@ protected:
|
||||
*/
|
||||
void writeTeams(JsonSerializer & handler);
|
||||
|
||||
|
||||
///common part triggered events of saving/loading
|
||||
void serializeTriggeredEvents(JsonSerializeFormat & handler);
|
||||
|
||||
/**
|
||||
* Reads triggered events, including victory/loss conditions
|
||||
*/
|
||||
@@ -91,7 +93,13 @@ protected:
|
||||
*/
|
||||
void writeTriggeredEvent(const TriggeredEvent & event, JsonNode & dest);
|
||||
|
||||
void writeDisposedHeroes(JsonSerializeFormat & handler);
|
||||
|
||||
void readDisposedHeroes(JsonSerializeFormat & handler);
|
||||
|
||||
void serializePredefinedHeroes(JsonSerializeFormat & handler);
|
||||
|
||||
void serializeRumors(JsonSerializeFormat & handler);
|
||||
|
||||
///common part of map attributes saving/loading
|
||||
void serializeOptions(JsonSerializeFormat & handler);
|
||||
@@ -130,7 +138,6 @@ private:
|
||||
*/
|
||||
void readPatchData();
|
||||
|
||||
|
||||
JsonNode input;
|
||||
};
|
||||
|
||||
@@ -174,11 +181,8 @@ private:
|
||||
|
||||
///configures object
|
||||
void configure();
|
||||
|
||||
};
|
||||
|
||||
si32 getIdentifier(const std::string & type, const std::string & name);
|
||||
|
||||
/**
|
||||
* Reads the map header.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user