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

Static validator for BT graph documents. More...

#include <BTGraphValidator.h>

Static Public Member Functions

static std::vector< BTValidationMessageValidateGraph (const NodeGraph::GraphDocument *graph)
 Validate a complete BT graph.
 

Static Private Member Functions

static void ValidateRootNode (const NodeGraph::GraphDocument *graph, std::vector< BTValidationMessage > &messages)
 Rule 1: Check for exactly one root node.
 
static void ValidateCycles (const NodeGraph::GraphDocument *graph, std::vector< BTValidationMessage > &messages)
 Rule 2: Detect cycles in graph.
 
static void ValidateChildrenCount (const NodeGraph::GraphDocument *graph, std::vector< BTValidationMessage > &messages)
 Rule 3: Validate child counts per node type.
 
static void ValidateOrphans (const NodeGraph::GraphDocument *graph, std::vector< BTValidationMessage > &messages)
 Rule 4: Check for orphan nodes (disconnected from root)
 
static void ValidateNodeTypes (const NodeGraph::GraphDocument *graph, std::vector< BTValidationMessage > &messages)
 Rule 5: Validate node types are registered.
 

Detailed Description

Static validator for BT graph documents.

Validates graph structure according to BT-specific rules. Returns list of validation messages (errors, warnings, info). Graph is valid if no error-level messages are returned.

Definition at line 56 of file BTGraphValidator.h.

Member Function Documentation

◆ ValidateChildrenCount()

void Olympe::AI::BTGraphValidator::ValidateChildrenCount ( const NodeGraph::GraphDocument graph,
std::vector< BTValidationMessage > &  messages 
)
staticprivate

Rule 3: Validate child counts per node type.

Parameters
graphGraph to validate
messagesOutput messages

Definition at line 158 of file BTGraphValidator.cpp.

References Olympe::AI::Error, Olympe::AI::BTNodeRegistry::Get(), and GetComponentTypeID_Static().

Referenced by ValidateGraph().

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

◆ ValidateCycles()

void Olympe::AI::BTGraphValidator::ValidateCycles ( const NodeGraph::GraphDocument graph,
std::vector< BTValidationMessage > &  messages 
)
staticprivate

Rule 2: Detect cycles in graph.

Parameters
graphGraph to validate
messagesOutput messages

Definition at line 92 of file BTGraphValidator.cpp.

References Olympe::AI::Error, and GetComponentTypeID_Static().

Referenced by ValidateGraph().

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

◆ ValidateGraph()

std::vector< BTValidationMessage > Olympe::AI::BTGraphValidator::ValidateGraph ( const NodeGraph::GraphDocument graph)
static

Validate a complete BT graph.

Parameters
graphGraph document to validate
Returns
Vector of validation messages (empty if valid)

Definition at line 17 of file BTGraphValidator.cpp.

References Olympe::AI::Error, GetComponentTypeID_Static(), ValidateChildrenCount(), ValidateCycles(), ValidateNodeTypes(), ValidateOrphans(), and ValidateRootNode().

Referenced by Olympe::AI::BTGraphCompiler::Compile(), Test3_ValidationValidRoot(), Test4_ValidationMultipleRoots(), Test5_ValidationCycle(), Test6_ValidateGraph(), and Test8_ValidationChildrenCount().

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

◆ ValidateNodeTypes()

void Olympe::AI::BTGraphValidator::ValidateNodeTypes ( const NodeGraph::GraphDocument graph,
std::vector< BTValidationMessage > &  messages 
)
staticprivate

Rule 5: Validate node types are registered.

Parameters
graphGraph to validate
messagesOutput messages

Definition at line 283 of file BTGraphValidator.cpp.

References Olympe::AI::Error, Olympe::AI::BTNodeRegistry::Get(), and GetComponentTypeID_Static().

Referenced by ValidateGraph().

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

◆ ValidateOrphans()

void Olympe::AI::BTGraphValidator::ValidateOrphans ( const NodeGraph::GraphDocument graph,
std::vector< BTValidationMessage > &  messages 
)
staticprivate

Rule 4: Check for orphan nodes (disconnected from root)

Parameters
graphGraph to validate
messagesOutput messages

Definition at line 198 of file BTGraphValidator.cpp.

References GetComponentTypeID_Static(), and Olympe::AI::Warning.

Referenced by ValidateGraph().

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

◆ ValidateRootNode()

void Olympe::AI::BTGraphValidator::ValidateRootNode ( const NodeGraph::GraphDocument graph,
std::vector< BTValidationMessage > &  messages 
)
staticprivate

Rule 1: Check for exactly one root node.

Parameters
graphGraph to validate
messagesOutput messages

Definition at line 40 of file BTGraphValidator.cpp.

References Olympe::AI::Error, and GetComponentTypeID_Static().

Referenced by ValidateGraph().

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