Ember
Loading...
Searching...
No Matches
EmberCore::BehaviorTreeValidator Class Reference

Unified validation system for behavior trees. More...

#include <BehaviorTreeValidator.h>

Classes

struct  ValidationIssue
struct  ValidationResult

Public Types

enum class  Severity { ERROR , WARNING }

Public Member Functions

 BehaviorTreeValidator ()
 BehaviorTreeValidator (const ParserConfig &config)
ValidationResult Validate (const BehaviorTree *tree) const
 Validate a behavior tree against the parser profile.

Static Public Member Functions

static ValidationResult ValidateWithConfig (const BehaviorTree *tree, const ParserConfig &config)
 Validate a behavior tree with profile override.

Private Member Functions

void ValidateTreeStructure (const BehaviorTree *tree, ValidationResult &result) const
void ValidateNode (const Node *node, ValidationResult &result, std::vector< const Node * > &visited, const EmberCore::String &path) const
void ValidateNodeType (const Node *node, ValidationResult &result, const EmberCore::String &path) const
void ValidateNodeAttributes (const Node *node, ValidationResult &result, const EmberCore::String &path) const
void ValidateChildCount (const Node *node, ValidationResult &result, const EmberCore::String &path) const
void ValidateBlackboards (const BehaviorTree *tree, ValidationResult &result) const
EmberCore::String BuildNodePath (const EmberCore::String &parent_path, const Node *node) const
bool HasCycles (const Node *node, std::vector< const Node * > &visited) const

Private Attributes

ParserConfig config_

Detailed Description

Unified validation system for behavior trees.

Validates behavior trees against parser profile rules. Used by both parser (errors block loading) and save (warnings allow override).

Definition at line 18 of file BehaviorTreeValidator.h.

Member Enumeration Documentation

◆ Severity

Enumerator
ERROR 
WARNING 

Definition at line 20 of file BehaviorTreeValidator.h.

Constructor & Destructor Documentation

◆ BehaviorTreeValidator() [1/2]

EmberCore::BehaviorTreeValidator::BehaviorTreeValidator ( )

Definition at line 8 of file BehaviorTreeValidator.cpp.

◆ BehaviorTreeValidator() [2/2]

EmberCore::BehaviorTreeValidator::BehaviorTreeValidator ( const ParserConfig & config)
explicit

Definition at line 12 of file BehaviorTreeValidator.cpp.

Member Function Documentation

◆ BuildNodePath()

EmberCore::String EmberCore::BehaviorTreeValidator::BuildNodePath ( const EmberCore::String & parent_path,
const Node * node ) const
private

Definition at line 262 of file BehaviorTreeValidator.cpp.

◆ HasCycles()

bool EmberCore::BehaviorTreeValidator::HasCycles ( const Node * node,
std::vector< const Node * > & visited ) const
private

Definition at line 274 of file BehaviorTreeValidator.cpp.

◆ Validate()

BehaviorTreeValidator::ValidationResult EmberCore::BehaviorTreeValidator::Validate ( const BehaviorTree * tree) const

Validate a behavior tree against the parser profile.

Checks:

  • Tree structure (root node, no cycles)
  • Node types are registered in profile
  • Required attributes present
  • Child count rules
  • Blackboard structure
Parameters
treeThe tree to validate
Returns
ValidationResult with errors and warnings

Definition at line 14 of file BehaviorTreeValidator.cpp.

◆ ValidateBlackboards()

void EmberCore::BehaviorTreeValidator::ValidateBlackboards ( const BehaviorTree * tree,
ValidationResult & result ) const
private

Definition at line 240 of file BehaviorTreeValidator.cpp.

◆ ValidateChildCount()

void EmberCore::BehaviorTreeValidator::ValidateChildCount ( const Node * node,
ValidationResult & result,
const EmberCore::String & path ) const
private

Definition at line 206 of file BehaviorTreeValidator.cpp.

◆ ValidateNode()

void EmberCore::BehaviorTreeValidator::ValidateNode ( const Node * node,
ValidationResult & result,
std::vector< const Node * > & visited,
const EmberCore::String & path ) const
private

Definition at line 76 of file BehaviorTreeValidator.cpp.

◆ ValidateNodeAttributes()

void EmberCore::BehaviorTreeValidator::ValidateNodeAttributes ( const Node * node,
ValidationResult & result,
const EmberCore::String & path ) const
private

Definition at line 169 of file BehaviorTreeValidator.cpp.

◆ ValidateNodeType()

void EmberCore::BehaviorTreeValidator::ValidateNodeType ( const Node * node,
ValidationResult & result,
const EmberCore::String & path ) const
private

Definition at line 118 of file BehaviorTreeValidator.cpp.

◆ ValidateTreeStructure()

void EmberCore::BehaviorTreeValidator::ValidateTreeStructure ( const BehaviorTree * tree,
ValidationResult & result ) const
private

Definition at line 54 of file BehaviorTreeValidator.cpp.

◆ ValidateWithConfig()

BehaviorTreeValidator::ValidationResult EmberCore::BehaviorTreeValidator::ValidateWithConfig ( const BehaviorTree * tree,
const ParserConfig & config )
static

Validate a behavior tree with profile override.

Parameters
treeThe tree to validate
configProfile to validate against
Returns
ValidationResult with errors and warnings

Definition at line 48 of file BehaviorTreeValidator.cpp.

Member Data Documentation

◆ config_

ParserConfig EmberCore::BehaviorTreeValidator::config_
private

Definition at line 97 of file BehaviorTreeValidator.h.


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