ObjectConfig.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * ObjectInfo.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 "../mapObjects/CompoundMapObjectID.h"
  12. VCMI_LIB_NAMESPACE_BEGIN
  13. class DLL_LINKAGE ObjectConfig
  14. {
  15. #ifdef ENABLE_TEMPLATE_EDITOR
  16. friend class ObjectSelector;
  17. #endif
  18. public:
  19. enum class EObjectCategory
  20. {
  21. OTHER = -2,
  22. ALL = -1,
  23. NONE = 0,
  24. CREATURE_BANK = 1,
  25. BONUS,
  26. DWELLING,
  27. RESOURCE,
  28. RESOURCE_GENERATOR,
  29. SPELL_SCROLL,
  30. RANDOM_ARTIFACT,
  31. PANDORAS_BOX,
  32. QUEST_ARTIFACT,
  33. SEER_HUT
  34. };
  35. void addBannedObject(const CompoundMapObjectID & objid);
  36. void addCustomObject(const ObjectInfo & object, const CompoundMapObjectID & objid);
  37. void clearBannedObjects();
  38. void clearCustomObjects();
  39. const std::vector<CompoundMapObjectID> & getBannedObjects() const;
  40. const std::vector<EObjectCategory> & getBannedObjectCategories() const;
  41. const std::vector<ObjectInfo> & getConfiguredObjects() const;
  42. void serializeJson(JsonSerializeFormat & handler);
  43. private:
  44. // TODO: Add convenience method for banning objects by name
  45. std::vector<CompoundMapObjectID> bannedObjects;
  46. std::vector<EObjectCategory> bannedObjectCategories;
  47. // TODO: In what format should I store custom objects?
  48. // Need to convert map serialization format to ObjectInfo
  49. std::vector<ObjectInfo> customObjects;
  50. };
  51. VCMI_LIB_NAMESPACE_END