ObjProperty.h 1.4 KB

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