Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
Olympe::TaskGraphMigrator_v3_to_v4 Class Reference

Converts task graph JSON from schema v3 to schema v4 (VisualScript). More...

#include <TaskGraphMigrator_v3_to_v4.h>

Static Public Member Functions

static bool Migrate (const std::string &inputPath, const std::string &outputPath, std::vector< std::string > &outErrors)
 Migrates a v3 JSON file to v4 and writes the result to disk.
 
static json MigrateJson (const json &v3data, std::vector< std::string > &outErrors)
 Performs the v3->v4 JSON transformation in memory.
 

Detailed Description

Converts task graph JSON from schema v3 to schema v4 (VisualScript).

Migration rules applied by MigrateJson():

  1. Checks schema_version == 3; adds error and returns {} if not.
  2. Copies name, description, blackboard / localBlackboard.
  3. For each node in nodes:
    • If NextOnSuccess != -1: adds an ExecConnection { NodeID, "Out", NextOnSuccess, "In" }.
    • If NextOnFailure != -1: adds an ExecConnection { NodeID, "OutFailure", NextOnFailure, "In" }.
    • Copies node fields (nodeType, nodeID, nodeName, parameters).
    • Removes NextOnSuccess / NextOnFailure from the output node object.
  4. Inserts "graphType": "VisualScript" and "schema_version": 4.
  5. Inserts an empty "DataConnections": [] array.

Definition at line 58 of file TaskGraphMigrator_v3_to_v4.h.

Member Function Documentation

◆ Migrate()

bool Olympe::TaskGraphMigrator_v3_to_v4::Migrate ( const std::string &  inputPath,
const std::string &  outputPath,
std::vector< std::string > &  outErrors 
)
static

Migrates a v3 JSON file to v4 and writes the result to disk.

Parameters
inputPathPath to the v3 JSON file to read.
outputPathPath where the v4 JSON file will be written.
outErrorsReceives human-readable error descriptions on failure.
Returns
true if the migration succeeded; false otherwise.

Definition at line 22 of file TaskGraphMigrator_v3_to_v4.cpp.

References GetComponentTypeID_Static(), MigrateJson(), and SYSTEM_LOG.

+ Here is the call graph for this function:

◆ MigrateJson()

json Olympe::TaskGraphMigrator_v3_to_v4::MigrateJson ( const json v3data,
std::vector< std::string > &  outErrors 
)
static

Performs the v3->v4 JSON transformation in memory.

Parameters
v3dataParsed JSON object representing the v3 graph.
outErrorsReceives human-readable error descriptions on failure.
Returns
Transformed v4 JSON object, or {} on error.

Definition at line 81 of file TaskGraphMigrator_v3_to_v4.cpp.

References GetComponentTypeID_Static(), and SYSTEM_LOG.

Referenced by Olympe::TaskGraphLoader::LoadFromJson(), and Migrate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: