ModVerificationInfo.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * ModVerificationInfo.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 "CModVersion.h"
  12. VCMI_LIB_NAMESPACE_BEGIN
  13. class JsonNode;
  14. struct ModVerificationInfo;
  15. using ModCompatibilityInfo = std::map<std::string, ModVerificationInfo>;
  16. struct DLL_LINKAGE ModVerificationInfo
  17. {
  18. /// human-readable mod name
  19. std::string name;
  20. /// version of the mod
  21. CModVersion version;
  22. /// CRC-32 checksum of the mod
  23. ui32 checksum = 0;
  24. /// parent mod ID, empty if root-level mod
  25. TModID parent;
  26. /// for serialization purposes
  27. bool impactsGameplay = true;
  28. static JsonNode jsonSerializeList(const ModCompatibilityInfo & input);
  29. static ModCompatibilityInfo jsonDeserializeList(const JsonNode & input);
  30. template <typename Handler>
  31. void serialize(Handler & h)
  32. {
  33. h & name;
  34. h & version;
  35. h & checksum;
  36. h & parent;
  37. h & impactsGameplay;
  38. }
  39. };
  40. VCMI_LIB_NAMESPACE_END