ObjProperty.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. OBELISK_VISITED,
  38. //creature-bank specific
  39. BANK_DAYCOUNTER,
  40. BANK_CLEAR,
  41. //object with reward
  42. REWARD_SELECT,
  43. REWARD_CLEARED
  44. };
  45. class NumericID : public StaticIdentifier<NumericID>
  46. {
  47. public:
  48. using StaticIdentifier<NumericID>::StaticIdentifier;
  49. static si32 decode(const std::string & identifier)
  50. {
  51. return std::stoi(identifier);
  52. }
  53. static std::string encode(const si32 index)
  54. {
  55. return std::to_string(index);
  56. }
  57. };
  58. using ObjPropertyID = VariantIdentifier<NumericID, MapObjectID, ObjectInstanceID, CreatureID, PlayerColor, TeamID>;
  59. VCMI_LIB_NAMESPACE_END