ObjProperty.h 1.5 KB

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