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

BlueprintMigrator - Converts v1 blueprints to v2 format Handles automatic position calculation and structure migration. More...

#include <BlueprintMigrator.h>

Classes

struct  NodeLayout
 

Public Member Functions

 BlueprintMigrator ()
 
 ~BlueprintMigrator ()
 
nlohmann::json MigrateToV2 (const nlohmann::json &v1Blueprint)
 
bool IsV2 (const nlohmann::json &blueprint) const
 

Private Member Functions

std::string DetectBlueprintType (const nlohmann::json &blueprint)
 
void MigrateBehaviorTree (const nlohmann::json &v1, nlohmann::json &v2Data)
 
void MigrateHFSM (const nlohmann::json &v1, nlohmann::json &v2Data)
 
void MigrateEntityPrefab (const nlohmann::json &v1, nlohmann::json &v2Data)
 
std::map< int, NodeLayoutCalculateHierarchicalLayout (const nlohmann::json &nodes, const std::map< int, std::vector< int > > &childrenMap, int rootId)
 
std::string GetCurrentTimestamp ()
 
void MigrateParameters (const nlohmann::json &v1Node, nlohmann::json &v2Node)
 

Static Private Attributes

static constexpr float HORIZONTAL_SPACING = 350.0f
 
static constexpr float VERTICAL_SPACING = 250.0f
 
static constexpr float START_X = 200.0f
 
static constexpr float START_Y = 300.0f
 

Detailed Description

BlueprintMigrator - Converts v1 blueprints to v2 format Handles automatic position calculation and structure migration.

Definition at line 28 of file BlueprintMigrator.h.

Constructor & Destructor Documentation

◆ BlueprintMigrator()

Olympe::BlueprintMigrator::BlueprintMigrator ( )

Definition at line 17 of file BlueprintMigrator.cpp.

◆ ~BlueprintMigrator()

Olympe::BlueprintMigrator::~BlueprintMigrator ( )

Definition at line 21 of file BlueprintMigrator.cpp.

Member Function Documentation

◆ CalculateHierarchicalLayout()

std::map< int, BlueprintMigrator::NodeLayout > Olympe::BlueprintMigrator::CalculateHierarchicalLayout ( const nlohmann::json nodes,
const std::map< int, std::vector< int > > &  childrenMap,
int  rootId 
)
private

Definition at line 265 of file BlueprintMigrator.cpp.

References GetComponentTypeID_Static(), HORIZONTAL_SPACING, Olympe::BlueprintMigrator::NodeLayout::nodeId, START_X, START_Y, and VERTICAL_SPACING.

Referenced by MigrateBehaviorTree().

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

◆ DetectBlueprintType()

std::string Olympe::BlueprintMigrator::DetectBlueprintType ( const nlohmann::json blueprint)
private

Definition at line 46 of file BlueprintMigrator.cpp.

References GetComponentTypeID_Static().

Referenced by MigrateToV2().

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

◆ GetCurrentTimestamp()

std::string Olympe::BlueprintMigrator::GetCurrentTimestamp ( )
private

Definition at line 31 of file BlueprintMigrator.cpp.

References GetComponentTypeID_Static().

Referenced by MigrateToV2().

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

◆ IsV2()

bool Olympe::BlueprintMigrator::IsV2 ( const nlohmann::json blueprint) const

Definition at line 25 of file BlueprintMigrator.cpp.

References GetComponentTypeID_Static().

Referenced by MigrateToV2().

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

◆ MigrateBehaviorTree()

void Olympe::BlueprintMigrator::MigrateBehaviorTree ( const nlohmann::json v1,
nlohmann::json v2Data 
)
private

Definition at line 118 of file BlueprintMigrator.cpp.

References CalculateHierarchicalLayout(), GetComponentTypeID_Static(), and MigrateParameters().

Referenced by MigrateToV2().

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

◆ MigrateEntityPrefab()

void Olympe::BlueprintMigrator::MigrateEntityPrefab ( const nlohmann::json v1,
nlohmann::json v2Data 
)
private

Definition at line 231 of file BlueprintMigrator.cpp.

References GetComponentTypeID_Static().

Referenced by MigrateToV2().

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

◆ MigrateHFSM()

void Olympe::BlueprintMigrator::MigrateHFSM ( const nlohmann::json v1,
nlohmann::json v2Data 
)
private

Definition at line 203 of file BlueprintMigrator.cpp.

References GetComponentTypeID_Static().

Referenced by MigrateToV2().

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

◆ MigrateParameters()

void Olympe::BlueprintMigrator::MigrateParameters ( const nlohmann::json v1Node,
nlohmann::json v2Node 
)
private

Definition at line 246 of file BlueprintMigrator.cpp.

References GetComponentTypeID_Static().

Referenced by MigrateBehaviorTree().

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

◆ MigrateToV2()

json Olympe::BlueprintMigrator::MigrateToV2 ( const nlohmann::json v1Blueprint)

Definition at line 67 of file BlueprintMigrator.cpp.

References DetectBlueprintType(), GetComponentTypeID_Static(), GetCurrentTimestamp(), IsV2(), MigrateBehaviorTree(), MigrateEntityPrefab(), and MigrateHFSM().

+ Here is the call graph for this function:

Member Data Documentation

◆ HORIZONTAL_SPACING

constexpr float Olympe::BlueprintMigrator::HORIZONTAL_SPACING = 350.0f
staticconstexprprivate

Definition at line 69 of file BlueprintMigrator.h.

Referenced by CalculateHierarchicalLayout().

◆ START_X

constexpr float Olympe::BlueprintMigrator::START_X = 200.0f
staticconstexprprivate

Definition at line 71 of file BlueprintMigrator.h.

Referenced by CalculateHierarchicalLayout().

◆ START_Y

constexpr float Olympe::BlueprintMigrator::START_Y = 300.0f
staticconstexprprivate

Definition at line 72 of file BlueprintMigrator.h.

Referenced by CalculateHierarchicalLayout().

◆ VERTICAL_SPACING

constexpr float Olympe::BlueprintMigrator::VERTICAL_SPACING = 250.0f
staticconstexprprivate

Definition at line 70 of file BlueprintMigrator.h.

Referenced by CalculateHierarchicalLayout().


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