ObjProperty.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * ObjProperty.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 "../constants/VariantIdentifier.h"
  12. #include "../constants/EntityIdentifiers.h"
  13. enum class ObjProperty : int8_t
  14. {
  15. INVALID,
  16. OWNER,
  17. BLOCKVIS,
  18. PRIMARY_STACK_COUNT,
  19. VISITORS,
  20. VISITED,
  21. ID,
  22. AVAILABLE_CREATURE,
  23. MONSTER_COUNT,
  24. MONSTER_POWER,
  25. MONSTER_EXP,
  26. MONSTER_RESTORE_TYPE,
  27. MONSTER_REFUSED_JOIN,
  28. //town-specific
  29. STRUCTURE_ADD_VISITING_HERO,
  30. STRUCTURE_CLEAR_VISITORS,
  31. STRUCTURE_ADD_GARRISONED_HERO, //changing buildings state
  32. BONUS_VALUE_FIRST,
  33. BONUS_VALUE_SECOND, //used in Rampart for special building that generates resources (storing resource type and quantity)
  34. SEERHUT_VISITED,
  35. SEERHUT_COMPLETE,
  36. KEYMASTER_VISITED,
  37. OBELISK_VISITED,
  38. //creature-bank specific
  39. BANK_DAYCOUNTER,
  40. BANK_RESET,
  41. BANK_CLEAR,
  42. //object with reward
  43. REWARD_RANDOMIZE,
  44. REWARD_SELECT,
  45. REWARD_CLEARED
  46. };
  47. class NumericID : public Identifier<NumericID>
  48. {
  49. public:
  50. using Identifier<NumericID>::Identifier;
  51. static si32 decode(const std::string & identifier)
  52. {
  53. return std::stoi(identifier);
  54. }
  55. static std::string encode(const si32 index)
  56. {
  57. return std::to_string(index);
  58. }
  59. };
  60. using ObjPropertyID = VariantIdentifier<NumericID, MapObjectID, ObjectInstanceID, CreatureID, PlayerColor, TeamID>;