mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Remove no longer used serialization methods
This commit is contained in:
@@ -53,19 +53,6 @@ public:
|
|||||||
std::string getNameTranslated() const override;
|
std::string getNameTranslated() const override;
|
||||||
void registerIcons(const IconRegistar & cb) const override;
|
void registerIcons(const IconRegistar & cb) const override;
|
||||||
BattleField getId() const override;
|
BattleField getId() const override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler & h, const int version)
|
|
||||||
{
|
|
||||||
h & name;
|
|
||||||
h & identifier;
|
|
||||||
h & isSpecial;
|
|
||||||
h & graphics;
|
|
||||||
h & icon;
|
|
||||||
h & iconIndex;
|
|
||||||
h & battlefield;
|
|
||||||
h & impassableHexes;
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DLL_LINKAGE BattleFieldService : public EntityServiceT<BattleField, BattleFieldInfo>
|
class DLL_LINKAGE BattleFieldService : public EntityServiceT<BattleField, BattleFieldInfo>
|
||||||
@@ -85,11 +72,6 @@ public:
|
|||||||
virtual const std::vector<std::string> & getTypeNames() const override;
|
virtual const std::vector<std::string> & getTypeNames() const override;
|
||||||
virtual std::vector<JsonNode> loadLegacyData() override;
|
virtual std::vector<JsonNode> loadLegacyData() override;
|
||||||
virtual std::vector<bool> getDefaultAllowed() const override;
|
virtual std::vector<bool> getDefaultAllowed() const override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler & h, const int version)
|
|
||||||
{
|
|
||||||
h & objects;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
VCMI_LIB_NAMESPACE_END
|
VCMI_LIB_NAMESPACE_END
|
||||||
|
|||||||
@@ -53,12 +53,6 @@ public:
|
|||||||
bool isCombined() const;
|
bool isCombined() const;
|
||||||
const std::vector<CArtifact*> & getConstituents() const;
|
const std::vector<CArtifact*> & getConstituents() const;
|
||||||
const std::vector<CArtifact*> & getPartOf() const;
|
const std::vector<CArtifact*> & getPartOf() const;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler & h, const int version)
|
|
||||||
{
|
|
||||||
h & constituents;
|
|
||||||
h & partOf;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DLL_LINKAGE CScrollArtifact
|
class DLL_LINKAGE CScrollArtifact
|
||||||
@@ -83,12 +77,6 @@ public:
|
|||||||
const std::vector <std::pair<ui16, Bonus>> & getBonusesPerLevel() const;
|
const std::vector <std::pair<ui16, Bonus>> & getBonusesPerLevel() const;
|
||||||
std::vector <std::pair<ui16, Bonus>> & getThresholdBonuses();
|
std::vector <std::pair<ui16, Bonus>> & getThresholdBonuses();
|
||||||
const std::vector <std::pair<ui16, Bonus>> & getThresholdBonuses() const;
|
const std::vector <std::pair<ui16, Bonus>> & getThresholdBonuses() const;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler & h, const int version)
|
|
||||||
{
|
|
||||||
h & bonusesPerLevel;
|
|
||||||
h & thresholdBonuses;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Container for artifacts. Not for instances.
|
// Container for artifacts. Not for instances.
|
||||||
@@ -144,25 +132,6 @@ public:
|
|||||||
// Is used for testing purposes only
|
// Is used for testing purposes only
|
||||||
void setImage(int32_t iconIndex, std::string image, std::string large);
|
void setImage(int32_t iconIndex, std::string image, std::string large);
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler & h, const int version)
|
|
||||||
{
|
|
||||||
h & static_cast<CBonusSystemNode&>(*this);
|
|
||||||
h & static_cast<CCombinedArtifact&>(*this);
|
|
||||||
h & static_cast<CGrowingArtifact&>(*this);
|
|
||||||
h & image;
|
|
||||||
h & large;
|
|
||||||
h & advMapDef;
|
|
||||||
h & iconIndex;
|
|
||||||
h & price;
|
|
||||||
h & possibleSlots;
|
|
||||||
h & aClass;
|
|
||||||
h & id;
|
|
||||||
h & modScope;
|
|
||||||
h & identifier;
|
|
||||||
h & warMachine;
|
|
||||||
h & onlyOnWaterMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
CArtifact();
|
CArtifact();
|
||||||
~CArtifact();
|
~CArtifact();
|
||||||
|
|
||||||
@@ -203,13 +172,6 @@ public:
|
|||||||
|
|
||||||
std::vector<bool> getDefaultAllowed() const override;
|
std::vector<bool> getDefaultAllowed() const override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & objects;
|
|
||||||
h & allowedArtifacts;
|
|
||||||
h & allocatedArtifacts;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const std::vector<std::string> & getTypeNames() const override;
|
const std::vector<std::string> & getTypeNames() const override;
|
||||||
CArtifact * loadFromJson(const std::string & scope, const JsonNode & json, const std::string & identifier, size_t index) override;
|
CArtifact * loadFromJson(const std::string & scope, const JsonNode & json, const std::string & identifier, size_t index) override;
|
||||||
|
|||||||
@@ -83,11 +83,6 @@ public:
|
|||||||
struct RayColor {
|
struct RayColor {
|
||||||
ColorRGBA start;
|
ColorRGBA start;
|
||||||
ColorRGBA end;
|
ColorRGBA end;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & start & end;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
double timeBetweenFidgets, idleAnimationTime,
|
double timeBetweenFidgets, idleAnimationTime,
|
||||||
@@ -100,25 +95,7 @@ public:
|
|||||||
|
|
||||||
AnimationPath projectileImageName;
|
AnimationPath projectileImageName;
|
||||||
std::vector<RayColor> projectileRay;
|
std::vector<RayColor> projectileRay;
|
||||||
//bool projectileSpin; //if true, appropriate projectile is spinning during flight
|
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & timeBetweenFidgets;
|
|
||||||
h & idleAnimationTime;
|
|
||||||
h & walkAnimationTime;
|
|
||||||
h & attackAnimationTime;
|
|
||||||
h & upperRightMissleOffsetX;
|
|
||||||
h & rightMissleOffsetX;
|
|
||||||
h & lowerRightMissleOffsetX;
|
|
||||||
h & upperRightMissleOffsetY;
|
|
||||||
h & rightMissleOffsetY;
|
|
||||||
h & lowerRightMissleOffsetY;
|
|
||||||
h & missleFrameAngles;
|
|
||||||
h & attackClimaxFrame;
|
|
||||||
h & projectileImageName;
|
|
||||||
h & projectileRay;
|
|
||||||
}
|
|
||||||
} animation;
|
} animation;
|
||||||
|
|
||||||
//sound info
|
//sound info
|
||||||
@@ -132,18 +109,6 @@ public:
|
|||||||
AudioPath wince; // attacked but did not die
|
AudioPath wince; // attacked but did not die
|
||||||
AudioPath startMoving;
|
AudioPath startMoving;
|
||||||
AudioPath endMoving;
|
AudioPath endMoving;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & attack;
|
|
||||||
h & defend;
|
|
||||||
h & killed;
|
|
||||||
h & move;
|
|
||||||
h & shoot;
|
|
||||||
h & wince;
|
|
||||||
h & startMoving;
|
|
||||||
h & endMoving;
|
|
||||||
}
|
|
||||||
} sounds;
|
} sounds;
|
||||||
|
|
||||||
ArtifactID warMachine;
|
ArtifactID warMachine;
|
||||||
@@ -210,35 +175,6 @@ public:
|
|||||||
void updateFrom(const JsonNode & data);
|
void updateFrom(const JsonNode & data);
|
||||||
void serializeJson(JsonSerializeFormat & handler);
|
void serializeJson(JsonSerializeFormat & handler);
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & static_cast<CBonusSystemNode&>(*this);
|
|
||||||
h & cost;
|
|
||||||
h & upgrades;
|
|
||||||
h & fightValue;
|
|
||||||
h & AIValue;
|
|
||||||
h & growth;
|
|
||||||
h & hordeGrowth;
|
|
||||||
h & ammMin;
|
|
||||||
h & ammMax;
|
|
||||||
h & level;
|
|
||||||
h & animDefName;
|
|
||||||
h & iconIndex;
|
|
||||||
h & smallIconName;
|
|
||||||
h & largeIconName;
|
|
||||||
|
|
||||||
h & idNumber;
|
|
||||||
h & faction;
|
|
||||||
h & sounds;
|
|
||||||
h & animation;
|
|
||||||
|
|
||||||
h & doubleWide;
|
|
||||||
h & special;
|
|
||||||
h & identifier;
|
|
||||||
h & modScope;
|
|
||||||
h & warMachine;
|
|
||||||
}
|
|
||||||
|
|
||||||
CCreature();
|
CCreature();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -303,19 +239,6 @@ public:
|
|||||||
std::vector<JsonNode> loadLegacyData() override;
|
std::vector<JsonNode> loadLegacyData() override;
|
||||||
|
|
||||||
std::vector<bool> getDefaultAllowed() const override;
|
std::vector<bool> getDefaultAllowed() const override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
//TODO: should be optimized, not all these informations needs to be serialized (same for ccreature)
|
|
||||||
h & doubledCreatures;
|
|
||||||
h & objects;
|
|
||||||
h & expRanks;
|
|
||||||
h & maxExpPerBattle;
|
|
||||||
h & expAfterUpgrade;
|
|
||||||
h & skillLevels;
|
|
||||||
h & skillRequirements;
|
|
||||||
h & commanderLevelPremy;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
VCMI_LIB_NAMESPACE_END
|
VCMI_LIB_NAMESPACE_END
|
||||||
|
|||||||
@@ -52,13 +52,6 @@ public:
|
|||||||
ui32 minAmount;
|
ui32 minAmount;
|
||||||
ui32 maxAmount;
|
ui32 maxAmount;
|
||||||
CreatureID creature;
|
CreatureID creature;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & minAmount;
|
|
||||||
h & maxAmount;
|
|
||||||
h & creature;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
si32 imageIndex = 0;
|
si32 imageIndex = 0;
|
||||||
|
|
||||||
@@ -104,29 +97,6 @@ public:
|
|||||||
|
|
||||||
void updateFrom(const JsonNode & data);
|
void updateFrom(const JsonNode & data);
|
||||||
void serializeJson(JsonSerializeFormat & handler);
|
void serializeJson(JsonSerializeFormat & handler);
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & ID;
|
|
||||||
h & imageIndex;
|
|
||||||
h & initialArmy;
|
|
||||||
h & heroClass;
|
|
||||||
h & secSkillsInit;
|
|
||||||
h & specialty;
|
|
||||||
h & spells;
|
|
||||||
h & haveSpellBook;
|
|
||||||
h & gender;
|
|
||||||
h & special;
|
|
||||||
h & onlyOnWaterMap;
|
|
||||||
h & onlyOnMapWithoutWater;
|
|
||||||
h & iconSpecSmall;
|
|
||||||
h & iconSpecLarge;
|
|
||||||
h & portraitSmall;
|
|
||||||
h & portraitLarge;
|
|
||||||
h & identifier;
|
|
||||||
h & modScope;
|
|
||||||
h & battleImage;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DLL_LINKAGE CHeroClass : public HeroClass
|
class DLL_LINKAGE CHeroClass : public HeroClass
|
||||||
@@ -183,25 +153,6 @@ public:
|
|||||||
void updateFrom(const JsonNode & data);
|
void updateFrom(const JsonNode & data);
|
||||||
void serializeJson(JsonSerializeFormat & handler);
|
void serializeJson(JsonSerializeFormat & handler);
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler & h, const int version)
|
|
||||||
{
|
|
||||||
h & modScope;
|
|
||||||
h & identifier;
|
|
||||||
h & faction;
|
|
||||||
h & id;
|
|
||||||
h & defaultTavernChance;
|
|
||||||
h & primarySkillInitial;
|
|
||||||
h & primarySkillLowLevel;
|
|
||||||
h & primarySkillHighLevel;
|
|
||||||
h & secSkillProbability;
|
|
||||||
h & selectionProbability;
|
|
||||||
h & affinity;
|
|
||||||
h & commander;
|
|
||||||
h & imageBattleMale;
|
|
||||||
h & imageBattleFemale;
|
|
||||||
h & imageMapMale;
|
|
||||||
h & imageMapFemale;
|
|
||||||
}
|
|
||||||
EAlignment getAlignment() const;
|
EAlignment getAlignment() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -218,11 +169,6 @@ public:
|
|||||||
|
|
||||||
~CHeroClassHandler();
|
~CHeroClassHandler();
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & objects;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const std::vector<std::string> & getTypeNames() const override;
|
const std::vector<std::string> & getTypeNames() const override;
|
||||||
CHeroClass * loadFromJson(const std::string & scope, const JsonNode & node, const std::string & identifier, size_t index) override;
|
CHeroClass * loadFromJson(const std::string & scope, const JsonNode & node, const std::string & identifier, size_t index) override;
|
||||||
@@ -262,13 +208,6 @@ public:
|
|||||||
|
|
||||||
std::vector<bool> getDefaultAllowed() const override;
|
std::vector<bool> getDefaultAllowed() const override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & classes;
|
|
||||||
h & objects;
|
|
||||||
h & expPerLevel;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const std::vector<std::string> & getTypeNames() const override;
|
const std::vector<std::string> & getTypeNames() const override;
|
||||||
CHero * loadFromJson(const std::string & scope, const JsonNode & node, const std::string & identifier, size_t index) override;
|
CHero * loadFromJson(const std::string & scope, const JsonNode & node, const std::string & identifier, size_t index) override;
|
||||||
|
|||||||
@@ -29,14 +29,6 @@ public:
|
|||||||
std::string iconMedium;
|
std::string iconMedium;
|
||||||
std::string iconLarge;
|
std::string iconLarge;
|
||||||
std::vector<std::shared_ptr<Bonus>> effects;
|
std::vector<std::shared_ptr<Bonus>> effects;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler & h, const int version)
|
|
||||||
{
|
|
||||||
h & iconSmall;
|
|
||||||
h & iconMedium;
|
|
||||||
h & iconLarge;
|
|
||||||
h & effects;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -82,17 +74,6 @@ public:
|
|||||||
|
|
||||||
bool onlyOnWaterMap;
|
bool onlyOnWaterMap;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler & h, const int version)
|
|
||||||
{
|
|
||||||
h & id;
|
|
||||||
h & identifier;
|
|
||||||
h & gainChance;
|
|
||||||
h & levels;
|
|
||||||
h & obligatoryMajor;
|
|
||||||
h & obligatoryMinor;
|
|
||||||
h & onlyOnWaterMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
friend class CSkillHandler;
|
friend class CSkillHandler;
|
||||||
friend DLL_LINKAGE std::ostream & operator<<(std::ostream & out, const CSkill & skill);
|
friend DLL_LINKAGE std::ostream & operator<<(std::ostream & out, const CSkill & skill);
|
||||||
friend DLL_LINKAGE std::ostream & operator<<(std::ostream & out, const CSkill::LevelInfo & info);
|
friend DLL_LINKAGE std::ostream & operator<<(std::ostream & out, const CSkill::LevelInfo & info);
|
||||||
@@ -111,11 +92,6 @@ public:
|
|||||||
|
|
||||||
std::vector<bool> getDefaultAllowed() const override;
|
std::vector<bool> getDefaultAllowed() const override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler & h, const int version)
|
|
||||||
{
|
|
||||||
h & objects;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const std::vector<std::string> & getTypeNames() const override;
|
const std::vector<std::string> & getTypeNames() const override;
|
||||||
CSkill * loadFromJson(const std::string & scope, const JsonNode & json, const std::string & identifier, size_t index) override;
|
CSkill * loadFromJson(const std::string & scope, const JsonNode & json, const std::string & identifier, size_t index) override;
|
||||||
|
|||||||
@@ -123,25 +123,6 @@ public:
|
|||||||
|
|
||||||
void addNewBonus(const std::shared_ptr<Bonus> & b, BonusList & bonusList) const;
|
void addNewBonus(const std::shared_ptr<Bonus> & b, BonusList & bonusList) const;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & modScope;
|
|
||||||
h & identifier;
|
|
||||||
h & town;
|
|
||||||
h & bid;
|
|
||||||
h & resources;
|
|
||||||
h & produce;
|
|
||||||
h & requirements;
|
|
||||||
h & upgrade;
|
|
||||||
h & mode;
|
|
||||||
h & subId;
|
|
||||||
h & height;
|
|
||||||
h & overrideBids;
|
|
||||||
h & buildingBonuses;
|
|
||||||
h & onVisitBonuses;
|
|
||||||
h & rewardableObjectInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
friend class CTownHandler;
|
friend class CTownHandler;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -160,17 +141,6 @@ struct DLL_LINKAGE CStructure
|
|||||||
std::string identifier;
|
std::string identifier;
|
||||||
|
|
||||||
bool hiddenUpgrade; // used only if "building" is upgrade, if true - structure on town screen will behave exactly like parent (mouse clicks, hover texts, etc)
|
bool hiddenUpgrade; // used only if "building" is upgrade, if true - structure on town screen will behave exactly like parent (mouse clicks, hover texts, etc)
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & pos;
|
|
||||||
h & defName;
|
|
||||||
h & borderName;
|
|
||||||
h & areaName;
|
|
||||||
h & identifier;
|
|
||||||
h & building;
|
|
||||||
h & buildable;
|
|
||||||
h & hiddenUpgrade;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct DLL_LINKAGE SPuzzleInfo
|
struct DLL_LINKAGE SPuzzleInfo
|
||||||
@@ -179,15 +149,6 @@ struct DLL_LINKAGE SPuzzleInfo
|
|||||||
si16 x, y; //position
|
si16 x, y; //position
|
||||||
ui16 whenUncovered; //determines the sequnce of discovering (the lesser it is the sooner puzzle will be discovered)
|
ui16 whenUncovered; //determines the sequnce of discovering (the lesser it is the sooner puzzle will be discovered)
|
||||||
ImagePath filename; //file with graphic of this puzzle
|
ImagePath filename; //file with graphic of this puzzle
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & number;
|
|
||||||
h & x;
|
|
||||||
h & y;
|
|
||||||
h & whenUncovered;
|
|
||||||
h & filename;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DLL_LINKAGE CFaction : public Faction
|
class DLL_LINKAGE CFaction : public Faction
|
||||||
@@ -238,20 +199,6 @@ public:
|
|||||||
|
|
||||||
void updateFrom(const JsonNode & data);
|
void updateFrom(const JsonNode & data);
|
||||||
void serializeJson(JsonSerializeFormat & handler);
|
void serializeJson(JsonSerializeFormat & handler);
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & modScope;
|
|
||||||
h & identifier;
|
|
||||||
h & index;
|
|
||||||
h & nativeTerrain;
|
|
||||||
h & boatType;
|
|
||||||
h & alignment;
|
|
||||||
h & town;
|
|
||||||
h & creatureBg120;
|
|
||||||
h & creatureBg130;
|
|
||||||
h & puzzleMap;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DLL_LINKAGE CTown
|
class DLL_LINKAGE CTown
|
||||||
@@ -323,45 +270,8 @@ public:
|
|||||||
std::string towerIconSmall;
|
std::string towerIconSmall;
|
||||||
std::string towerIconLarge;
|
std::string towerIconLarge;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & icons;
|
|
||||||
h & iconSmall;
|
|
||||||
h & iconLarge;
|
|
||||||
h & tavernVideo;
|
|
||||||
h & musicTheme;
|
|
||||||
h & townBackground;
|
|
||||||
h & guildBackground;
|
|
||||||
h & guildWindow;
|
|
||||||
h & buildingsIcons;
|
|
||||||
h & hallBackground;
|
|
||||||
h & hallSlots;
|
|
||||||
h & structures;
|
|
||||||
h & siegePrefix;
|
|
||||||
h & siegePositions;
|
|
||||||
h & siegeShooter;
|
|
||||||
h & towerIconSmall;
|
|
||||||
h & towerIconLarge;
|
|
||||||
}
|
|
||||||
} clientInfo;
|
} clientInfo;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & namesCount;
|
|
||||||
h & faction;
|
|
||||||
h & creatures;
|
|
||||||
h & dwellings;
|
|
||||||
h & dwellingNames;
|
|
||||||
h & buildings;
|
|
||||||
h & hordeLvl;
|
|
||||||
h & mageLevel;
|
|
||||||
h & primaryRes;
|
|
||||||
h & warMachine;
|
|
||||||
h & clientInfo;
|
|
||||||
h & moatAbility;
|
|
||||||
h & defaultTavernChance;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
///generated bonusing buildings messages for all towns of this type.
|
///generated bonusing buildings messages for all towns of this type.
|
||||||
mutable std::map<BuildingSubID::EBuildingSubID, const std::string> specialMessages; //may be changed by CGTownBuilding::getVisitingBonusGreeting() const
|
mutable std::map<BuildingSubID::EBuildingSubID, const std::string> specialMessages; //may be changed by CGTownBuilding::getVisitingBonusGreeting() const
|
||||||
@@ -445,12 +355,6 @@ public:
|
|||||||
|
|
||||||
static void loadSpecialBuildingBonuses(const JsonNode & source, BonusList & bonusList, CBuilding * building);
|
static void loadSpecialBuildingBonuses(const JsonNode & source, BonusList & bonusList, CBuilding * building);
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & objects;
|
|
||||||
h & randomTown;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const std::vector<std::string> & getTypeNames() const override;
|
const std::vector<std::string> & getTypeNames() const override;
|
||||||
CFaction * loadFromJson(const std::string & scope, const JsonNode & data, const std::string & identifier, size_t index) override;
|
CFaction * loadFromJson(const std::string & scope, const JsonNode & data, const std::string & identifier, size_t index) override;
|
||||||
|
|||||||
@@ -54,23 +54,6 @@ public:
|
|||||||
std::vector<BattleHex> getBlocked(BattleHex hex) const; //returns vector of hexes blocked by obstacle when it's placed on hex 'hex'
|
std::vector<BattleHex> getBlocked(BattleHex hex) const; //returns vector of hexes blocked by obstacle when it's placed on hex 'hex'
|
||||||
|
|
||||||
bool isAppropriate(const TerrainId terrainType, const BattleField & specialBattlefield) const;
|
bool isAppropriate(const TerrainId terrainType, const BattleField & specialBattlefield) const;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & obstacle;
|
|
||||||
h & iconIndex;
|
|
||||||
h & identifier;
|
|
||||||
h & animation;
|
|
||||||
h & appearAnimation;
|
|
||||||
h & appearSound;
|
|
||||||
h & allowedTerrains;
|
|
||||||
h & allowedSpecialBfields;
|
|
||||||
h & isAbsoluteObstacle;
|
|
||||||
h & isForegroundObstacle;
|
|
||||||
h & width;
|
|
||||||
h & height;
|
|
||||||
h & blockedTiles;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DLL_LINKAGE ObstacleService : public EntityServiceT<Obstacle, ObstacleInfo>
|
class DLL_LINKAGE ObstacleService : public EntityServiceT<Obstacle, ObstacleInfo>
|
||||||
@@ -89,11 +72,6 @@ public:
|
|||||||
const std::vector<std::string> & getTypeNames() const override;
|
const std::vector<std::string> & getTypeNames() const override;
|
||||||
std::vector<JsonNode> loadLegacyData() override;
|
std::vector<JsonNode> loadLegacyData() override;
|
||||||
std::vector<bool> getDefaultAllowed() const override;
|
std::vector<bool> getDefaultAllowed() const override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler & h, const int version)
|
|
||||||
{
|
|
||||||
h & objects;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
VCMI_LIB_NAMESPACE_END
|
VCMI_LIB_NAMESPACE_END
|
||||||
|
|||||||
@@ -24,12 +24,6 @@ struct DLL_LINKAGE RiverPaletteAnimation
|
|||||||
int32_t start;
|
int32_t start;
|
||||||
/// total numbers of colors to cycle
|
/// total numbers of colors to cycle
|
||||||
int32_t length;
|
int32_t length;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler& h, const int version)
|
|
||||||
{
|
|
||||||
h & start;
|
|
||||||
h & length;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DLL_LINKAGE RiverType : public EntityT<RiverId>
|
class DLL_LINKAGE RiverType : public EntityT<RiverId>
|
||||||
@@ -57,16 +51,6 @@ public:
|
|||||||
std::vector<RiverPaletteAnimation> paletteAnimation;
|
std::vector<RiverPaletteAnimation> paletteAnimation;
|
||||||
|
|
||||||
RiverType();
|
RiverType();
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler& h, const int version)
|
|
||||||
{
|
|
||||||
h & tilesFilename;
|
|
||||||
h & identifier;
|
|
||||||
h & modScope;
|
|
||||||
h & deltaName;
|
|
||||||
h & id;
|
|
||||||
h & paletteAnimation;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DLL_LINKAGE RiverTypeService : public EntityServiceT<RiverId, RiverType>
|
class DLL_LINKAGE RiverTypeService : public EntityServiceT<RiverId, RiverType>
|
||||||
@@ -88,11 +72,6 @@ public:
|
|||||||
virtual const std::vector<std::string> & getTypeNames() const override;
|
virtual const std::vector<std::string> & getTypeNames() const override;
|
||||||
virtual std::vector<JsonNode> loadLegacyData() override;
|
virtual std::vector<JsonNode> loadLegacyData() override;
|
||||||
virtual std::vector<bool> getDefaultAllowed() const override;
|
virtual std::vector<bool> getDefaultAllowed() const override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler & h, const int version)
|
|
||||||
{
|
|
||||||
h & objects;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
VCMI_LIB_NAMESPACE_END
|
VCMI_LIB_NAMESPACE_END
|
||||||
|
|||||||
@@ -41,15 +41,6 @@ public:
|
|||||||
ui8 movementCost;
|
ui8 movementCost;
|
||||||
|
|
||||||
RoadType();
|
RoadType();
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler& h, const int version)
|
|
||||||
{
|
|
||||||
h & tilesFilename;
|
|
||||||
h & identifier;
|
|
||||||
h & modScope;
|
|
||||||
h & id;
|
|
||||||
h & movementCost;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DLL_LINKAGE RoadTypeService : public EntityServiceT<RoadId, RoadType>
|
class DLL_LINKAGE RoadTypeService : public EntityServiceT<RoadId, RoadType>
|
||||||
@@ -71,11 +62,6 @@ public:
|
|||||||
virtual const std::vector<std::string> & getTypeNames() const override;
|
virtual const std::vector<std::string> & getTypeNames() const override;
|
||||||
virtual std::vector<JsonNode> loadLegacyData() override;
|
virtual std::vector<JsonNode> loadLegacyData() override;
|
||||||
virtual std::vector<bool> getDefaultAllowed() const override;
|
virtual std::vector<bool> getDefaultAllowed() const override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler & h, const int version)
|
|
||||||
{
|
|
||||||
h & objects;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
VCMI_LIB_NAMESPACE_END
|
VCMI_LIB_NAMESPACE_END
|
||||||
|
|||||||
@@ -91,30 +91,6 @@ public:
|
|||||||
bool isSurface() const;
|
bool isSurface() const;
|
||||||
bool isUnderground() const;
|
bool isUnderground() const;
|
||||||
bool isTransitionRequired() const;
|
bool isTransitionRequired() const;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & battleFields;
|
|
||||||
h & prohibitTransitions;
|
|
||||||
h & minimapBlocked;
|
|
||||||
h & minimapUnblocked;
|
|
||||||
h & modScope;
|
|
||||||
h & identifier;
|
|
||||||
h & musicFilename;
|
|
||||||
h & tilesFilename;
|
|
||||||
h & shortIdentifier;
|
|
||||||
h & terrainViewPatterns;
|
|
||||||
h & rockTerrain;
|
|
||||||
h & river;
|
|
||||||
h & paletteAnimation;
|
|
||||||
|
|
||||||
h & id;
|
|
||||||
h & moveCost;
|
|
||||||
h & horseSound;
|
|
||||||
h & horseSoundPenalty;
|
|
||||||
h & passabilityType;
|
|
||||||
h & transitionRequired;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DLL_LINKAGE TerrainTypeService : public EntityServiceT<TerrainId, TerrainType>
|
class DLL_LINKAGE TerrainTypeService : public EntityServiceT<TerrainId, TerrainType>
|
||||||
@@ -134,11 +110,6 @@ public:
|
|||||||
virtual const std::vector<std::string> & getTypeNames() const override;
|
virtual const std::vector<std::string> & getTypeNames() const override;
|
||||||
virtual std::vector<JsonNode> loadLegacyData() override;
|
virtual std::vector<JsonNode> loadLegacyData() override;
|
||||||
virtual std::vector<bool> getDefaultAllowed() const override;
|
virtual std::vector<bool> getDefaultAllowed() const override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler & h, const int version)
|
|
||||||
{
|
|
||||||
h & objects;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
VCMI_LIB_NAMESPACE_END
|
VCMI_LIB_NAMESPACE_END
|
||||||
|
|||||||
@@ -112,20 +112,6 @@ public:
|
|||||||
|
|
||||||
/// Returns object configuration, if available. Otherwise returns NULL
|
/// Returns object configuration, if available. Otherwise returns NULL
|
||||||
virtual std::unique_ptr<IObjectInfo> getObjectInfo(std::shared_ptr<const ObjectTemplate> tmpl) const;
|
virtual std::unique_ptr<IObjectInfo> getObjectInfo(std::shared_ptr<const ObjectTemplate> tmpl) const;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & type;
|
|
||||||
h & subtype;
|
|
||||||
h & templates;
|
|
||||||
h & rmgInfo;
|
|
||||||
h & modScope;
|
|
||||||
h & typeName;
|
|
||||||
h & subTypeName;
|
|
||||||
h & sounds;
|
|
||||||
h & aiValue;
|
|
||||||
h & battlefield;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
VCMI_LIB_NAMESPACE_END
|
VCMI_LIB_NAMESPACE_END
|
||||||
|
|||||||
@@ -92,15 +92,6 @@ public:
|
|||||||
bool hasNameTextID() const override;
|
bool hasNameTextID() const override;
|
||||||
|
|
||||||
std::unique_ptr<IObjectInfo> getObjectInfo(std::shared_ptr<const ObjectTemplate> tmpl) const override;
|
std::unique_ptr<IObjectInfo> getObjectInfo(std::shared_ptr<const ObjectTemplate> tmpl) const override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & levels;
|
|
||||||
h & bankResetDuration;
|
|
||||||
h & blockVisit;
|
|
||||||
h & coastVisitable;
|
|
||||||
h & static_cast<CDefaultObjectTypeHandler<CBank>&>(*this);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
VCMI_LIB_NAMESPACE_END
|
VCMI_LIB_NAMESPACE_END
|
||||||
|
|||||||
@@ -62,16 +62,6 @@ public:
|
|||||||
std::string getJsonKey() const;
|
std::string getJsonKey() const;
|
||||||
std::string getNameTextID() const;
|
std::string getNameTextID() const;
|
||||||
std::string getNameTranslated() const;
|
std::string getNameTranslated() const;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & id;
|
|
||||||
h & handlerName;
|
|
||||||
h & base;
|
|
||||||
h & objects;
|
|
||||||
h & identifier;
|
|
||||||
h & modScope;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Main class responsible for creation of all adventure map objects
|
/// Main class responsible for creation of all adventure map objects
|
||||||
@@ -130,11 +120,6 @@ public:
|
|||||||
std::string getObjectHandlerName(MapObjectID type) const;
|
std::string getObjectHandlerName(MapObjectID type) const;
|
||||||
|
|
||||||
std::string getJsonKey(MapObjectID type) const;
|
std::string getJsonKey(MapObjectID type) const;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & objects;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
VCMI_LIB_NAMESPACE_END
|
VCMI_LIB_NAMESPACE_END
|
||||||
|
|||||||
@@ -30,13 +30,6 @@ public:
|
|||||||
void configureObject(CGObjectInstance * object, CRandomGenerator & rng) const override;
|
void configureObject(CGObjectInstance * object, CRandomGenerator & rng) const override;
|
||||||
|
|
||||||
std::unique_ptr<IObjectInfo> getObjectInfo(std::shared_ptr<const ObjectTemplate> tmpl) const override;
|
std::unique_ptr<IObjectInfo> getObjectInfo(std::shared_ptr<const ObjectTemplate> tmpl) const override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
AObjectTypeHandler::serialize(h, version);
|
|
||||||
|
|
||||||
h & objectInfo;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
VCMI_LIB_NAMESPACE_END
|
VCMI_LIB_NAMESPACE_END
|
||||||
|
|||||||
@@ -66,14 +66,6 @@ public:
|
|||||||
|
|
||||||
bool hasNameTextID() const override;
|
bool hasNameTextID() const override;
|
||||||
std::string getNameTextID() const override;
|
std::string getNameTextID() const override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & filtersJson;
|
|
||||||
h & faction;
|
|
||||||
h & filters;
|
|
||||||
h & static_cast<CDefaultObjectTypeHandler<CGTownInstance>&>(*this);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class CHeroInstanceConstructor : public CDefaultObjectTypeHandler<CGHeroInstance>
|
class CHeroInstanceConstructor : public CDefaultObjectTypeHandler<CGHeroInstance>
|
||||||
@@ -93,14 +85,6 @@ public:
|
|||||||
|
|
||||||
bool hasNameTextID() const override;
|
bool hasNameTextID() const override;
|
||||||
std::string getNameTextID() const override;
|
std::string getNameTextID() const override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & filtersJson;
|
|
||||||
h & heroClass;
|
|
||||||
h & filters;
|
|
||||||
h & static_cast<CDefaultObjectTypeHandler<CGHeroInstance>&>(*this);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DLL_LINKAGE BoatInstanceConstructor : public CDefaultObjectTypeHandler<CGBoat>
|
class DLL_LINKAGE BoatInstanceConstructor : public CDefaultObjectTypeHandler<CGBoat>
|
||||||
@@ -122,18 +106,6 @@ public:
|
|||||||
|
|
||||||
/// Returns boat preview animation, for use in Shipyards
|
/// Returns boat preview animation, for use in Shipyards
|
||||||
AnimationPath getBoatAnimationName() const;
|
AnimationPath getBoatAnimationName() const;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & static_cast<CDefaultObjectTypeHandler<CGBoat>&>(*this);
|
|
||||||
h & layer;
|
|
||||||
h & onboardAssaultAllowed;
|
|
||||||
h & onboardVisitAllowed;
|
|
||||||
h & bonuses;
|
|
||||||
h & actualAnimation;
|
|
||||||
h & overlayAnimation;
|
|
||||||
h & flagAnimations;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class MarketInstanceConstructor : public CDefaultObjectTypeHandler<CGMarket>
|
class MarketInstanceConstructor : public CDefaultObjectTypeHandler<CGMarket>
|
||||||
@@ -152,12 +124,6 @@ public:
|
|||||||
void initializeObject(CGMarket * object) const override;
|
void initializeObject(CGMarket * object) const override;
|
||||||
void randomizeObject(CGMarket * object, CRandomGenerator & rng) const override;
|
void randomizeObject(CGMarket * object, CRandomGenerator & rng) const override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & static_cast<CDefaultObjectTypeHandler<CGMarket>&>(*this);
|
|
||||||
h & marketModes;
|
|
||||||
h & marketEfficiency;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
VCMI_LIB_NAMESPACE_END
|
VCMI_LIB_NAMESPACE_END
|
||||||
|
|||||||
@@ -33,13 +33,6 @@ public:
|
|||||||
|
|
||||||
bool producesCreature(const CCreature * crea) const;
|
bool producesCreature(const CCreature * crea) const;
|
||||||
std::vector<const CCreature *> getProducedCreatures() const;
|
std::vector<const CCreature *> getProducedCreatures() const;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & availableCreatures;
|
|
||||||
h & guards;
|
|
||||||
h & static_cast<CDefaultObjectTypeHandler<CGDwelling>&>(*this);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
VCMI_LIB_NAMESPACE_END
|
VCMI_LIB_NAMESPACE_END
|
||||||
|
|||||||
@@ -24,11 +24,6 @@ protected:
|
|||||||
void initializeObject(HillFort * object) const override;
|
void initializeObject(HillFort * object) const override;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & static_cast<AObjectTypeHandler&>(*this);
|
|
||||||
h & parameters;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
VCMI_LIB_NAMESPACE_END
|
VCMI_LIB_NAMESPACE_END
|
||||||
|
|||||||
@@ -33,14 +33,6 @@ struct DLL_LINKAGE RandomMapInfo
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
void setMapLimit(ui32 val) { mapLimit = val; }
|
void setMapLimit(ui32 val) { mapLimit = val; }
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & value;
|
|
||||||
h & mapLimit;
|
|
||||||
h & zoneLimit;
|
|
||||||
h & rarity;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
VCMI_LIB_NAMESPACE_END
|
VCMI_LIB_NAMESPACE_END
|
||||||
|
|||||||
@@ -18,13 +18,6 @@ struct SObjectSounds
|
|||||||
std::vector<AudioPath> ambient;
|
std::vector<AudioPath> ambient;
|
||||||
std::vector<AudioPath> visit;
|
std::vector<AudioPath> visit;
|
||||||
std::vector<AudioPath> removal;
|
std::vector<AudioPath> removal;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & ambient;
|
|
||||||
h & visit;
|
|
||||||
h & removal;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
VCMI_LIB_NAMESPACE_END
|
VCMI_LIB_NAMESPACE_END
|
||||||
|
|||||||
@@ -24,11 +24,6 @@ protected:
|
|||||||
void initializeObject(CGShipyard * object) const override;
|
void initializeObject(CGShipyard * object) const override;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & static_cast<AObjectTypeHandler&>(*this);
|
|
||||||
h & parameters;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
VCMI_LIB_NAMESPACE_END
|
VCMI_LIB_NAMESPACE_END
|
||||||
|
|||||||
@@ -92,7 +92,18 @@ public:
|
|||||||
for(auto * bonusingBuilding : bonusingBuildings)
|
for(auto * bonusingBuilding : bonusingBuildings)
|
||||||
bonusingBuilding->town = this;
|
bonusingBuilding->town = this;
|
||||||
|
|
||||||
h & town;
|
if (h.saving)
|
||||||
|
{
|
||||||
|
CFaction * faction = town ? town->faction : nullptr;
|
||||||
|
h & faction;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CFaction * faction;
|
||||||
|
h & faction;
|
||||||
|
town = faction ? faction->town : nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
h & townAndVis;
|
h & townAndVis;
|
||||||
BONUS_TREE_DESERIALIZATION_FIX
|
BONUS_TREE_DESERIALIZATION_FIX
|
||||||
|
|
||||||
|
|||||||
@@ -22,11 +22,6 @@ public:
|
|||||||
std::vector<ui32> resVals; //default values of resources in gold
|
std::vector<ui32> resVals; //default values of resources in gold
|
||||||
|
|
||||||
CObjectHandler();
|
CObjectHandler();
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
|
||||||
{
|
|
||||||
h & resVals;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
VCMI_LIB_NAMESPACE_END
|
VCMI_LIB_NAMESPACE_END
|
||||||
|
|||||||
@@ -267,39 +267,6 @@ public:
|
|||||||
void updateFrom(const JsonNode & data);
|
void updateFrom(const JsonNode & data);
|
||||||
void serializeJson(JsonSerializeFormat & handler);
|
void serializeJson(JsonSerializeFormat & handler);
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler & h, const int version)
|
|
||||||
{
|
|
||||||
h & identifier;
|
|
||||||
if (version > 820)
|
|
||||||
h & modScope;
|
|
||||||
h & id;
|
|
||||||
h & level;
|
|
||||||
h & power;
|
|
||||||
h & probabilities;
|
|
||||||
h & attributes;
|
|
||||||
h & combat;
|
|
||||||
h & creatureAbility;
|
|
||||||
h & positiveness;
|
|
||||||
h & counteredSpells;
|
|
||||||
h & rising;
|
|
||||||
h & damage;
|
|
||||||
h & offensive;
|
|
||||||
h & targetType;
|
|
||||||
h & targetCondition;
|
|
||||||
h & iconImmune;
|
|
||||||
h & defaultProbability;
|
|
||||||
h & special;
|
|
||||||
h & castSound;
|
|
||||||
h & iconBook;
|
|
||||||
h & iconEffect;
|
|
||||||
h & iconScenarioBonus;
|
|
||||||
h & iconScroll;
|
|
||||||
h & levels;
|
|
||||||
h & school;
|
|
||||||
h & animationInfo;
|
|
||||||
h & nonMagical;
|
|
||||||
h & onlyOnWaterMap;
|
|
||||||
}
|
|
||||||
friend class CSpellHandler;
|
friend class CSpellHandler;
|
||||||
friend class Graphics;
|
friend class Graphics;
|
||||||
friend class test::CSpellTest;
|
friend class test::CSpellTest;
|
||||||
@@ -384,15 +351,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
std::vector<bool> getDefaultAllowed() const override;
|
std::vector<bool> getDefaultAllowed() const override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler & h, const int version)
|
|
||||||
{
|
|
||||||
h & objects;
|
|
||||||
if(!h.saving)
|
|
||||||
{
|
|
||||||
afterLoadFinalization();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const std::vector<std::string> & getTypeNames() const override;
|
const std::vector<std::string> & getTypeNames() const override;
|
||||||
CSpell * loadFromJson(const std::string & scope, const JsonNode & json, const std::string & identifier, size_t index) override;
|
CSpell * loadFromJson(const std::string & scope, const JsonNode & json, const std::string & identifier, size_t index) override;
|
||||||
|
|||||||
Reference in New Issue
Block a user