BonusParams.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * BonusParams.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include "Bonus.h"
  12. #include "../GameConstants.h"
  13. #include "../JsonNode.h"
  14. VCMI_LIB_NAMESPACE_BEGIN
  15. struct DLL_LINKAGE BonusParams {
  16. bool isConverted;
  17. BonusType type = BonusType::NONE;
  18. TBonusSubtype subtype = -1;
  19. std::string subtypeStr;
  20. bool subtypeRelevant = false;
  21. BonusValueType valueType = BonusValueType::BASE_NUMBER;
  22. bool valueTypeRelevant = false;
  23. si32 val = 0;
  24. bool valRelevant = false;
  25. BonusSource targetType = BonusSource::SECONDARY_SKILL;
  26. bool targetTypeRelevant = false;
  27. BonusParams(bool isConverted = true) : isConverted(isConverted) {};
  28. BonusParams(std::string deprecatedTypeStr, std::string deprecatedSubtypeStr = "", int deprecatedSubtype = 0);
  29. const JsonNode & toJson();
  30. CSelector toSelector();
  31. private:
  32. JsonNode ret;
  33. bool jsonCreated = false;
  34. };
  35. VCMI_LIB_NAMESPACE_END