ESerializationVersion.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. RELEASE_150 = 840,
  33. MINIMAL = RELEASE_150,
  34. VOTING_SIMTURNS, // 841 - allow modification of simturns duration via vote
  35. REMOVE_TEXT_CONTAINER_SIZE_T, // 842 Fixed serialization of size_t from text containers
  36. BANK_UNIT_PLACEMENT, // 843 Banks have unit placement flag
  37. RELEASE_156 = BANK_UNIT_PLACEMENT,
  38. COMPACT_STRING_SERIALIZATION, // 844 - optimized serialization of previously encountered strings
  39. COMPACT_INTEGER_SERIALIZATION, // 845 - serialize integers in forms similar to protobuf
  40. REMOVE_FOG_OF_WAR_POINTER, // 846 - fog of war is serialized as reference instead of pointer
  41. SIMPLE_TEXT_CONTAINER_SERIALIZATION, // 847 - text container is serialized using common routine instead of custom approach
  42. MAP_FORMAT_ADDITIONAL_INFOS, // 848 - serialize new infos in map format
  43. REMOVE_LIB_RNG, // 849 - removed random number generators from library classes
  44. HIGHSCORE_PARAMETERS, // 850 - saves parameter for campaign
  45. PLAYER_HANDICAP, // 851 - player handicap selection at game start
  46. STATISTICS, // 852 - removed random number generators from library classes
  47. CAMPAIGN_REGIONS, // 853 - configurable campaign regions
  48. EVENTS_PLAYER_SET, // 854 - map & town events use std::set instead of bitmask to store player list
  49. NEW_TOWN_BUILDINGS, // 855 - old bonusing buildings have been removed
  50. STATISTICS_SCREEN, // 856 - extent statistic functions
  51. NEW_MARKETS, // 857 - reworked market classes
  52. PLAYER_STATE_OWNED_OBJECTS, // 858 - player state stores all owned objects in a single list
  53. SAVE_COMPATIBILITY_FIXES, // 859 - implementation of previoulsy postponed changes to serialization
  54. CHRONICLES_SUPPORT, // 860 - support for heroes chronicles
  55. PER_MAP_GAME_SETTINGS, // 861 - game settings are now stored per-map
  56. CAMPAIGN_OUTRO_SUPPORT, // 862 - support for campaign outro video
  57. REWARDABLE_BANKS, // 863 - team state contains list of scouted objects, coast visitable rewardable objects
  58. CURRENT = REWARDABLE_BANKS
  59. };