ObjectConfig.h 1.4 KB

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