BonusEnum.cpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * BonusEnum.cpp, 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. #include "StdInc.h"
  11. #include "BonusEnum.h"
  12. VCMI_LIB_NAMESPACE_BEGIN
  13. #define BONUS_NAME(x) { #x, BonusType::x },
  14. const std::map<std::string, BonusType> bonusNameMap = {
  15. BONUS_LIST
  16. };
  17. #undef BONUS_NAME
  18. #define BONUS_VALUE(x) { #x, BonusValueType::x },
  19. const std::map<std::string, BonusValueType> bonusValueMap = { BONUS_VALUE_LIST };
  20. #undef BONUS_VALUE
  21. #define BONUS_SOURCE(x) { #x, BonusSource::x },
  22. const std::map<std::string, BonusSource> bonusSourceMap = { BONUS_SOURCE_LIST };
  23. #undef BONUS_SOURCE
  24. #define BONUS_ITEM(x) { #x, BonusDuration::x },
  25. const std::map<std::string, BonusDuration> bonusDurationMap =
  26. {
  27. BONUS_ITEM(PERMANENT)
  28. BONUS_ITEM(ONE_BATTLE)
  29. BONUS_ITEM(ONE_DAY)
  30. BONUS_ITEM(ONE_WEEK)
  31. BONUS_ITEM(N_TURNS)
  32. BONUS_ITEM(N_DAYS)
  33. BONUS_ITEM(UNTIL_BEING_ATTACKED)
  34. BONUS_ITEM(UNTIL_ATTACK)
  35. BONUS_ITEM(STACK_GETS_TURN)
  36. BONUS_ITEM(COMMANDER_KILLED)
  37. { "UNITL_BEING_ATTACKED", BonusDuration::UNTIL_BEING_ATTACKED }//typo, but used in some mods
  38. };
  39. #undef BONUS_ITEM
  40. #define BONUS_ITEM(x) { #x, BonusLimitEffect::x },
  41. const std::map<std::string, BonusLimitEffect> bonusLimitEffect =
  42. {
  43. BONUS_ITEM(NO_LIMIT)
  44. BONUS_ITEM(ONLY_DISTANCE_FIGHT)
  45. BONUS_ITEM(ONLY_MELEE_FIGHT)
  46. };
  47. #undef BONUS_ITEM
  48. VCMI_LIB_NAMESPACE_END