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

BlueprintValidator - Validates node graphs against catalogs Ensures type safety and parameter consistency Also provides JSON schema validation and normalization. More...

#include <BlueprintValidator.h>

Public Member Functions

 BlueprintValidator ()
 
 ~BlueprintValidator ()
 
std::vector< ValidationErrorValidateGraph (const NodeGraph *graph)
 
std::vector< ValidationErrorValidateNode (const NodeGraph *graph, int nodeId)
 
bool IsGraphValid (const NodeGraph *graph)
 
int GetErrorCount (const std::vector< ValidationError > &errors, ErrorSeverity severity) const
 
std::string DetectType (const nlohmann::json &blueprint)
 
bool Normalize (nlohmann::json &blueprint)
 
bool ValidateJSON (const nlohmann::json &blueprint, std::string &errors)
 

Static Public Member Functions

static const charSeverityToString (ErrorSeverity severity)
 
static ImVec4 SeverityToColor (ErrorSeverity severity)
 

Private Member Functions

void ValidateNodeType (const NodeGraph *graph, const GraphNode *node, std::vector< ValidationError > &errors)
 
void ValidateNodeParameters (const NodeGraph *graph, const GraphNode *node, std::vector< ValidationError > &errors)
 
void ValidateNodeLinks (const NodeGraph *graph, const GraphNode *node, std::vector< ValidationError > &errors)
 
bool ValidateBehaviorTree (const nlohmann::json &blueprint, std::string &errors)
 
bool ValidateHFSM (const nlohmann::json &blueprint, std::string &errors)
 
bool ValidateEntityPrefab (const nlohmann::json &blueprint, std::string &errors)
 
bool ValidateUIBlueprint (const nlohmann::json &blueprint, std::string &errors)
 
bool ValidateLevel (const nlohmann::json &blueprint, std::string &errors)
 

Detailed Description

BlueprintValidator - Validates node graphs against catalogs Ensures type safety and parameter consistency Also provides JSON schema validation and normalization.

Definition at line 48 of file BlueprintValidator.h.

Constructor & Destructor Documentation

◆ BlueprintValidator()

Olympe::BlueprintValidator::BlueprintValidator ( )

Definition at line 12 of file BlueprintValidator.cpp.

◆ ~BlueprintValidator()

Olympe::BlueprintValidator::~BlueprintValidator ( )

Definition at line 16 of file BlueprintValidator.cpp.

Member Function Documentation

◆ DetectType()

std::string Olympe::BlueprintValidator::DetectType ( const nlohmann::json blueprint)

Definition at line 294 of file BlueprintValidator.cpp.

References GetComponentTypeID_Static().

Referenced by Normalize().

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

◆ GetErrorCount()

int Olympe::BlueprintValidator::GetErrorCount ( const std::vector< ValidationError > &  errors,
ErrorSeverity  severity 
) const

Definition at line 90 of file BlueprintValidator.cpp.

References GetComponentTypeID_Static().

Referenced by Olympe::ValidationPanel::RenderErrorSummary().

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

◆ IsGraphValid()

bool Olympe::BlueprintValidator::IsGraphValid ( const NodeGraph graph)

Definition at line 74 of file BlueprintValidator.cpp.

References Olympe::Critical, Olympe::Error, GetComponentTypeID_Static(), and ValidateGraph().

+ Here is the call graph for this function:

◆ Normalize()

bool Olympe::BlueprintValidator::Normalize ( nlohmann::json blueprint)

Definition at line 359 of file BlueprintValidator.cpp.

References DetectType(), and GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ SeverityToColor()

ImVec4 Olympe::BlueprintValidator::SeverityToColor ( ErrorSeverity  severity)
static

Definition at line 113 of file BlueprintValidator.cpp.

References Olympe::Critical, Olympe::Error, GetComponentTypeID_Static(), Olympe::Info, and Olympe::Warning.

Referenced by Olympe::ValidationPanel::RenderErrorList(), and Olympe::ValidationPanel::RenderErrorSummary().

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

◆ SeverityToString()

const char * Olympe::BlueprintValidator::SeverityToString ( ErrorSeverity  severity)
static

Definition at line 101 of file BlueprintValidator.cpp.

References Olympe::Critical, Olympe::Error, Olympe::Info, and Olympe::Warning.

Referenced by Olympe::ValidationPanel::RenderErrorList().

+ Here is the caller graph for this function:

◆ ValidateBehaviorTree()

bool Olympe::BlueprintValidator::ValidateBehaviorTree ( const nlohmann::json blueprint,
std::string &  errors 
)
private

Definition at line 451 of file BlueprintValidator.cpp.

References GetComponentTypeID_Static().

Referenced by ValidateJSON().

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

◆ ValidateEntityPrefab()

bool Olympe::BlueprintValidator::ValidateEntityPrefab ( const nlohmann::json blueprint,
std::string &  errors 
)
private

Definition at line 501 of file BlueprintValidator.cpp.

References GetComponentTypeID_Static().

Referenced by ValidateJSON().

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

◆ ValidateGraph()

std::vector< ValidationError > Olympe::BlueprintValidator::ValidateGraph ( const NodeGraph graph)

Definition at line 20 of file BlueprintValidator.cpp.

References Olympe::Critical, GetComponentTypeID_Static(), ValidateNodeLinks(), ValidateNodeParameters(), ValidateNodeType(), and Olympe::Warning.

Referenced by IsGraphValid(), and Olympe::ValidationPanel::ValidateActiveGraph().

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

◆ ValidateHFSM()

bool Olympe::BlueprintValidator::ValidateHFSM ( const nlohmann::json blueprint,
std::string &  errors 
)
private

Definition at line 476 of file BlueprintValidator.cpp.

References GetComponentTypeID_Static().

Referenced by ValidateJSON().

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

◆ ValidateJSON()

bool Olympe::BlueprintValidator::ValidateJSON ( const nlohmann::json blueprint,
std::string &  errors 
)

Definition at line 412 of file BlueprintValidator.cpp.

References GetComponentTypeID_Static(), ValidateBehaviorTree(), ValidateEntityPrefab(), ValidateHFSM(), ValidateLevel(), and ValidateUIBlueprint().

+ Here is the call graph for this function:

◆ ValidateLevel()

bool Olympe::BlueprintValidator::ValidateLevel ( const nlohmann::json blueprint,
std::string &  errors 
)
private

Definition at line 532 of file BlueprintValidator.cpp.

References GetComponentTypeID_Static().

Referenced by ValidateJSON().

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

◆ ValidateNode()

std::vector< ValidationError > Olympe::BlueprintValidator::ValidateNode ( const NodeGraph graph,
int  nodeId 
)

Definition at line 49 of file BlueprintValidator.cpp.

References Olympe::Critical, GetComponentTypeID_Static(), ValidateNodeLinks(), ValidateNodeParameters(), and ValidateNodeType().

+ Here is the call graph for this function:

◆ ValidateNodeLinks()

void Olympe::BlueprintValidator::ValidateNodeLinks ( const NodeGraph graph,
const GraphNode node,
std::vector< ValidationError > &  errors 
)
private

Definition at line 250 of file BlueprintValidator.cpp.

References Olympe::BT_Decorator, Olympe::BT_Selector, Olympe::BT_Sequence, Olympe::Error, GetComponentTypeID_Static(), and Olympe::Warning.

Referenced by ValidateGraph(), and ValidateNode().

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

◆ ValidateNodeParameters()

void Olympe::BlueprintValidator::ValidateNodeParameters ( const NodeGraph graph,
const GraphNode node,
std::vector< ValidationError > &  errors 
)
private

◆ ValidateNodeType()

void Olympe::BlueprintValidator::ValidateNodeType ( const NodeGraph graph,
const GraphNode node,
std::vector< ValidationError > &  errors 
)
private

Definition at line 125 of file BlueprintValidator.cpp.

References Olympe::BT_Action, Olympe::BT_Condition, Olympe::BT_Decorator, Olympe::Error, Olympe::EnumCatalogManager::Get(), and GetComponentTypeID_Static().

Referenced by ValidateGraph(), and ValidateNode().

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

◆ ValidateUIBlueprint()

bool Olympe::BlueprintValidator::ValidateUIBlueprint ( const nlohmann::json blueprint,
std::string &  errors 
)
private

Definition at line 520 of file BlueprintValidator.cpp.

References GetComponentTypeID_Static().

Referenced by ValidateJSON().

+ 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: