1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Refactoring of serialization versioning handling

- Removed 'version' field from serialize() method
- Handler classes - Binary(De)Serializer now have 'version' field
- Serialization versioning now uses named enum

Save compatibility with 1.4.X saves should be intact
This commit is contained in:
Ivan Savenko
2024-01-20 20:34:51 +02:00
parent 6b760089a4
commit 0c07384293
129 changed files with 498 additions and 473 deletions

View File

@@ -10,6 +10,7 @@
#pragma once
#include "BinaryDeserializer.h"
#include "SerializerVersion.h"
VCMI_LIB_NAMESPACE_BEGIN
@@ -21,11 +22,11 @@ public:
std::string fName;
std::unique_ptr<std::fstream> sfile;
CLoadFile(const boost::filesystem::path & fname, int minimalVersion = SERIALIZATION_VERSION); //throws!
CLoadFile(const boost::filesystem::path & fname, ESerializationVersion minimalVersion = ESerializationVersion::CURRENT); //throws!
virtual ~CLoadFile();
int read(void * data, unsigned size) override; //throws!
void openNextFile(const boost::filesystem::path & fname, int minimalVersion); //throws!
void openNextFile(const boost::filesystem::path & fname, ESerializationVersion minimalVersion); //throws!
void clear();
void reportState(vstd::CLoggerBase * out) override;