1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-22 22:13:35 +02:00
vcmi/lib/bonuses/BonusParams.h

39 lines
1023 B
C++
Raw Normal View History

/*
* BonusParams.h, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
#pragma once
2023-05-01 19:29:53 +02:00
#include "Bonus.h"
#include "../GameConstants.h"
#include "../json/JsonNode.h"
VCMI_LIB_NAMESPACE_BEGIN
struct DLL_LINKAGE BonusParams {
bool isConverted;
BonusType type = BonusType::NONE;
std::optional<BonusSubtypeID> subtype = std::nullopt;
2023-05-05 18:08:36 +02:00
std::optional<BonusValueType> valueType = std::nullopt;
std::optional<si32> val = std::nullopt;
std::optional<BonusSource> targetType = std::nullopt;
BonusParams(bool isConverted = true) : isConverted(isConverted) {};
BonusParams(std::string deprecatedTypeStr, std::string deprecatedSubtypeStr = "", int deprecatedSubtype = 0);
const JsonNode & toJson();
CSelector toSelector();
private:
JsonNode ret;
bool jsonCreated = false;
};
extern DLL_LINKAGE const std::set<std::string> deprecatedBonusSet;
VCMI_LIB_NAMESPACE_END