diff --git a/cmake_modules/VCMI_lib.cmake b/cmake_modules/VCMI_lib.cmake index ff5ab40ab..39b8044f5 100644 --- a/cmake_modules/VCMI_lib.cmake +++ b/cmake_modules/VCMI_lib.cmake @@ -557,7 +557,7 @@ macro(add_main_lib TARGET_NAME LIBRARY_TYPE) ${MAIN_LIB_DIR}/serializer/JsonSerializer.h ${MAIN_LIB_DIR}/serializer/JsonUpdater.h ${MAIN_LIB_DIR}/serializer/Cast.h - ${MAIN_LIB_DIR}/serializer/SerializerVersion.h + ${MAIN_LIB_DIR}/serializer/ESerializationVersion.h ${MAIN_LIB_DIR}/spells/AbilityCaster.h ${MAIN_LIB_DIR}/spells/AdventureSpellMechanics.h diff --git a/lib/serializer/BinaryDeserializer.h b/lib/serializer/BinaryDeserializer.h index c4ddc49c6..b34addee5 100644 --- a/lib/serializer/BinaryDeserializer.h +++ b/lib/serializer/BinaryDeserializer.h @@ -11,7 +11,7 @@ #include "CSerializer.h" #include "CTypeList.h" -#include "SerializerVersion.h" +#include "ESerializationVersion.h" #include "../mapObjects/CGHeroInstance.h" VCMI_LIB_NAMESPACE_BEGIN diff --git a/lib/serializer/BinarySerializer.h b/lib/serializer/BinarySerializer.h index 36c0922f2..9f465e539 100644 --- a/lib/serializer/BinarySerializer.h +++ b/lib/serializer/BinarySerializer.h @@ -11,7 +11,7 @@ #include "CSerializer.h" #include "CTypeList.h" -#include "SerializerVersion.h" +#include "ESerializationVersion.h" #include "../mapObjects/CArmedInstance.h" VCMI_LIB_NAMESPACE_BEGIN diff --git a/lib/serializer/CLoadFile.h b/lib/serializer/CLoadFile.h index 00b5264b8..405c1f99c 100644 --- a/lib/serializer/CLoadFile.h +++ b/lib/serializer/CLoadFile.h @@ -10,7 +10,6 @@ #pragma once #include "BinaryDeserializer.h" -#include "SerializerVersion.h" VCMI_LIB_NAMESPACE_BEGIN diff --git a/lib/serializer/CSerializer.h b/lib/serializer/CSerializer.h index 491ad80cb..6907c2008 100644 --- a/lib/serializer/CSerializer.h +++ b/lib/serializer/CSerializer.h @@ -136,9 +136,9 @@ struct is_serializeable using No = char (&)[2]; template - static Yes test(U * data, S* arg1 = 0, typename std::enable_if_tserialize(*arg1))>> * = 0); + static Yes test(U * data, S* arg1 = nullptr, typename std::enable_if_tserialize(*arg1))>> * = nullptr); static No test(...); - static const bool value = sizeof(Yes) == sizeof(is_serializeable::test((typename std::remove_reference::type>::type*)0)); + static const bool value = sizeof(Yes) == sizeof(is_serializeable::test((typename std::remove_reference::type>::type*)nullptr)); }; template //metafunction returning CGObjectInstance if T is its derivate or T elsewise diff --git a/lib/serializer/SerializerVersion.h b/lib/serializer/ESerializationVersion.h similarity index 53% rename from lib/serializer/SerializerVersion.h rename to lib/serializer/ESerializationVersion.h index 1be8194e3..bcbd1e77c 100644 --- a/lib/serializer/SerializerVersion.h +++ b/lib/serializer/ESerializationVersion.h @@ -9,18 +9,18 @@ */ #pragma once -/// This is enumeration that controls save compatibility support -/// - 'MINIMAL' represents older supported version counter. Save can be loaded if its version is at least 'MINIMAL' -/// - 'CURRENT' represent current save version. All saves are created using 'CURRENT' version +/// This enumeration controls save compatibility support. +/// - 'MINIMAL' represents the oldest supported version counter. A saved game can be loaded if its version is at least 'MINIMAL'. +/// - 'CURRENT' represents the current save version. Saved games are created using the 'CURRENT' version. /// -/// To add save-breaking change: -/// - change 'MINIMAL' to value higher than CURRENT -/// - remove all version enumerations inbetween +/// To make a save-breaking change: +/// - change 'MINIMAL' to a value higher than 'CURRENT' +/// - remove all keys in enumeration between 'MINIMAL' and 'CURRENT' as well as all their usage (will be detected by compiler) /// - change 'CURRENT' to 'CURRENT = MINIMAL' /// -/// To add non-breaking change: +/// To make a non-breaking change: /// - add new enumeration value before 'CURRENT' -/// - change 'CURRENT' to 'CURRENT = NEW_TEST_KEY' +/// - change 'CURRENT' to 'CURRENT = NEW_TEST_KEY'. /// /// To check for version in serialize() call use form /// if (h.version >= Handler::Version::NEW_TEST_KEY) @@ -32,7 +32,7 @@ enum class ESerializationVersion : int32_t NONE = 0, MINIMAL = 831, - RELEASE_143, // 832 + text container in campaigns, +starting hero in RMG options + RELEASE_143, // 832 +text container in campaigns, +starting hero in RMG options HAS_EXTRA_OPTIONS, // 833 +extra options struct as part of startinfo CURRENT = HAS_EXTRA_OPTIONS