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

Preparation for user-defined bonus types

This commit is contained in:
Ivan Savenko
2025-06-09 11:40:21 +03:00
parent 527885de21
commit 51832c4fb9
13 changed files with 72 additions and 123 deletions

View File

@@ -41,6 +41,7 @@ private:
class DLL_LINKAGE CBonusTypeHandler : public IBonusTypeHandler
{
std::vector<std::string> bonusNames;
public:
CBonusTypeHandler();
virtual ~CBonusTypeHandler();
@@ -52,6 +53,10 @@ public:
void loadObject(std::string scope, std::string name, const JsonNode & data) override;
void loadObject(std::string scope, std::string name, const JsonNode & data, size_t index) override;
BonusType stringToBonus(const std::string & name) const;
const std::string bonusToString(BonusType bonus) const;
std::vector<BonusType> getAllObjets() const;
private:
void loadItem(const JsonNode & source, CBonusType & dest, const std::string & name) const;