mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +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:
@@ -65,8 +65,8 @@ public:
|
||||
ConstTransitivePtr<CCommanderInstance> commander;
|
||||
const CGBoat *boat; //set to CGBoat when sailing
|
||||
|
||||
static const ui32 UNINITIALIZED_PORTRAIT = -1;
|
||||
static const ui32 UNINITIALIZED_MANA = -1;
|
||||
static const si32 UNINITIALIZED_PORTRAIT = -1;
|
||||
static const si32 UNINITIALIZED_MANA = -1;
|
||||
static const ui32 UNINITIALIZED_MOVEMENT = -1;
|
||||
|
||||
//std::vector<const CArtifact*> artifacts; //hero's artifacts from bag
|
||||
@@ -204,7 +204,7 @@ public:
|
||||
void initHero(CRandomGenerator & rand);
|
||||
void initHero(CRandomGenerator & rand, HeroTypeID SUBID);
|
||||
|
||||
void putArtifact(ArtifactPosition pos, CArtifactInstance *art);
|
||||
void putArtifact(ArtifactPosition pos, CArtifactInstance * art) override;
|
||||
void putInBackpack(CArtifactInstance *art);
|
||||
void initExp(CRandomGenerator & rand);
|
||||
void initArmy(CRandomGenerator & rand, IArmyDescriptor *dst = nullptr);
|
||||
@@ -258,12 +258,20 @@ public:
|
||||
std::string getObjectName() const override;
|
||||
protected:
|
||||
void setPropertyDer(ui8 what, ui32 val) override;//synchr
|
||||
///common part of hero instance and hero definition
|
||||
void serializeCommonOptions(JsonSerializeFormat & handler);
|
||||
|
||||
void serializeJsonOptions(JsonSerializeFormat & handler) override;
|
||||
|
||||
private:
|
||||
void levelUpAutomatically(CRandomGenerator & rand);
|
||||
|
||||
public:
|
||||
std::string getHeroTypeName() const;
|
||||
void setHeroTypeName(const std::string & identifier);
|
||||
|
||||
void serializeJsonDefinition(JsonSerializeFormat & handler);
|
||||
|
||||
template <typename Handler> void serialize(Handler &h, const int version)
|
||||
{
|
||||
h & static_cast<CArmedInstance&>(*this);
|
||||
|
||||
Reference in New Issue
Block a user