Upgrade to version 4

This commit is contained in:
Aurélie Delhaie
2022-10-16 17:37:42 +02:00
parent fad936e21b
commit dcc90fb009
6 changed files with 400 additions and 32 deletions

View File

@@ -8,6 +8,7 @@
#include "version2upgrader.h"
#include "version3upgrader.h"
#include "version4upgrader.h"
#define SAVE_FILENAME "data.json"
@@ -47,7 +48,7 @@ void save_to_file(QJsonObject save) {
int main(int argc, char *argv[])
{
std::cout << "Chronos Save Upgrader v2" << std::endl;
std::cout << "Chronos Save Upgrader v2.1" << std::endl;
std::cout << "by Aurélie Delhaie - https://github.com/mojitaurelie/chronos-save-updater" << std::endl << std::endl;
QCoreApplication::setApplicationName("Chronos");
QJsonObject save = open_save();
@@ -62,6 +63,11 @@ int main(int argc, char *argv[])
save = Version3Upgrader::Upgrade(save);
std::cout << "[INFO] Save upgraded to version 3" << std::endl;
}
case 3: {
std::cout << "[INFO] Upgrading to version 4" << std::endl;
save = Version4Upgrader::Upgrade(save);
std::cout << "[INFO] Save upgraded to version 4" << std::endl;
}
}
std::cout << "[INFO] Saving..." << std::endl;
save_to_file(save);