ESerializationVersion.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * ESerializationVersion.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. /// This enumeration controls save compatibility support.
  12. /// - 'MINIMAL' represents the oldest supported version counter. A saved game can be loaded if its version is at least 'MINIMAL'.
  13. /// - 'CURRENT' represents the current save version. Saved games are created using the 'CURRENT' version.
  14. ///
  15. /// To make a save-breaking change:
  16. /// - change 'MINIMAL' to a value higher than 'CURRENT'
  17. /// - remove all keys in enumeration between 'MINIMAL' and 'CURRENT' as well as all their usage (will be detected by compiler)
  18. /// - change 'CURRENT' to 'CURRENT = MINIMAL'
  19. ///
  20. /// To make a non-breaking change:
  21. /// - add new enumeration value before 'CURRENT'
  22. /// - change 'CURRENT' to 'CURRENT = NEW_TEST_KEY'.
  23. ///
  24. /// To check for version in serialize() call use form
  25. /// if (h.version >= Handler::Version::NEW_TEST_KEY)
  26. /// h & newKey; // loading/saving save of a new version
  27. /// else
  28. /// newKey = saneDefaultValue; // loading of old save
  29. enum class ESerializationVersion : int32_t
  30. {
  31. NONE = 0,
  32. MINIMAL = 831,
  33. RELEASE_143, // 832 +text container in campaigns, +starting hero in RMG options
  34. HAS_EXTRA_OPTIONS, // 833 +extra options struct as part of startinfo
  35. DESTROYED_OBJECTS, // 834 +list of objects destroyed by player
  36. CAMPAIGN_MAP_TRANSLATIONS, // 835 +campaigns include translations for its maps
  37. JSON_FLAGS, // 836 json uses new format for flags
  38. MANA_LIMIT, // 837 change MANA_PER_KNOWLEDGE to percentage
  39. BONUS_META_STRING, // 838 bonuses use MetaString instead of std::string for descriptions
  40. TURN_TIMERS_STATE, // 839 current state of turn timers is serialized
  41. ARTIFACT_COSTUMES, // 840 swappable artifacts set added
  42. RELEASE_150 = ARTIFACT_COSTUMES, // for convenience
  43. VOTING_SIMTURNS, // 841 - allow modification of simturns duration via vote
  44. REMOVE_TEXT_CONTAINER_SIZE_T, // 842 Fixed serialization of size_t from text containers
  45. BANK_UNIT_PLACEMENT, // 843 Banks have unit placement flag
  46. RELEASE_152 = BANK_UNIT_PLACEMENT,
  47. COMPACT_STRING_SERIALIZATION, // 844 - optimized serialization of previously encountered strings
  48. COMPACT_INTEGER_SERIALIZATION, // 845 - serialize integers in forms similar to protobuf
  49. REMOVE_FOG_OF_WAR_POINTER, // 846 - fog of war is serialized as reference instead of pointer
  50. SIMPLE_TEXT_CONTAINER_SERIALIZATION, // 847 - text container is serialized using common routine instead of custom approach
  51. MAP_FORMAT_ADDITIONAL_INFOS, // 848 - serialize new infos in map format
  52. CURRENT = MAP_FORMAT_ADDITIONAL_INFOS
  53. };