Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
GraphMigrator.h
Go to the documentation of this file.
1/**
2 * @file GraphMigrator.h
3 * @brief Migration system for JSON versions
4 * @author Olympe Engine
5 * @date 2026-02-18
6 *
7 * @details
8 * Detects and migrates JSON files from legacy and v1 formats to v2 unified schema.
9 */
10
11#pragma once
12
13#include "GraphDocument.h"
14#include "../json_helper.h"
15
16namespace Olympe {
17namespace NodeGraph {
18
19/**
20 * @class GraphMigrator
21 * @brief Handles migration from old JSON formats to v2
22 */
24public:
25 /**
26 * @brief Load graph with automatic migration
27 * @param j JSON object
28 * @return GraphDocument with migrated data
29 */
31
32private:
33 /**
34 * @brief Detect schema version
35 * @param j JSON object
36 * @return Version number (0 = legacy BT, 1 = v1 blueprint, 2 = v2)
37 */
38 static int DetectSchemaVersion(const json& j);
39
40 /**
41 * @brief Migrate legacy BT format to v2
42 * @param v1 Legacy JSON
43 * @return v2 JSON
44 */
45 static json MigrateLegacyBTToV2(const json& v1);
46
47 /**
48 * @brief Migrate v1 Blueprint format to v2
49 * @param v1 v1 JSON
50 * @return v2 JSON
51 */
52 static json MigrateV1BlueprintToV2(const json& v1);
53};
54
55} // namespace NodeGraph
56} // namespace Olympe
ComponentTypeID GetComponentTypeID_Static()
Definition ECS_Entity.h:56
Document class for managing node graphs.
Main document class for a node graph.
Handles migration from old JSON formats to v2.
static GraphDocument LoadWithMigration(const json &j)
Load graph with automatic migration.
static int DetectSchemaVersion(const json &j)
Detect schema version.
static json MigrateV1BlueprintToV2(const json &v1)
Migrate v1 Blueprint format to v2.
static json MigrateLegacyBTToV2(const json &v1)
Migrate legacy BT format to v2.
< Provides AssetID and INVALID_ASSET_ID
nlohmann::json json