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

#include <BehaviorTree.h>

Public Member Functions

bool LoadTreeFromFile (const std::string &filepath, uint32_t treeId)
 
bool ReloadTree (uint32_t treeId)
 
bool ValidateTree (const BehaviorTreeAsset &tree, std::string &errorMessage) const
 
const BehaviorTreeAssetGetTree (uint32_t treeId) const
 
void Clear ()
 
uint32_t GetTreeIdFromPath (const std::string &treePath) const
 
bool IsTreeLoadedByPath (const std::string &treePath) const
 
const BehaviorTreeAssetGetTreeByPath (const std::string &treePath) const
 
const BehaviorTreeAssetGetTreeByAnyId (uint32_t treeId) const
 
std::string GetTreePathFromId (uint32_t treeId) const
 
void DebugPrintLoadedTrees () const
 
bool ValidateSubGraphPath (const std::string &path) const
 
bool DetectCircularDependencies (uint32_t graphId, uint32_t nodeId, const BehaviorTreeAsset *parentTree, std::set< std::string > &visited)
 
std::vector< std::string > GetValidationErrors (uint32_t graphId)
 

Static Public Member Functions

static BehaviorTreeManagerGet ()
 

Private Member Functions

 BehaviorTreeManager ()=default
 

Private Attributes

std::vector< BehaviorTreeAssetm_trees
 
std::map< std::string, uint32_tm_pathToIdMap
 

Detailed Description

Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 376 of file BehaviorTree.h.

Constructor & Destructor Documentation

◆ BehaviorTreeManager()

BehaviorTreeManager::BehaviorTreeManager ( )
privatedefault

Member Function Documentation

◆ Clear()

void BehaviorTreeManager::Clear ( )

◆ DebugPrintLoadedTrees()

void BehaviorTreeManager::DebugPrintLoadedTrees ( ) const
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 945 of file BehaviorTree.cpp.

References GetComponentTypeID_Static(), m_pathToIdMap, and m_trees.

Referenced by Olympe::BehaviorTreeDebugWindow::RefreshEntityList(), and Olympe::BehaviorTreeDebugWindow::RenderRuntimeInfo().

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

◆ DetectCircularDependencies()

bool BehaviorTreeManager::DetectCircularDependencies ( uint32_t  graphId,
uint32_t  nodeId,
const BehaviorTreeAsset parentTree,
std::set< std::string > &  visited 
)

◆ Get()

static BehaviorTreeManager & BehaviorTreeManager::Get ( )
inlinestatic

◆ GetTree()

const BehaviorTreeAsset * BehaviorTreeManager::GetTree ( uint32_t  treeId) const
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 333 of file BehaviorTree.cpp.

References GetComponentTypeID_Static(), and m_trees.

Referenced by GetTreeByPath(), GetValidationErrors(), and PrefabFactory::InstantiateBehaviorTreeRuntime().

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

◆ GetTreeByAnyId()

const BehaviorTreeAsset * BehaviorTreeManager::GetTreeByAnyId ( uint32_t  treeId) const

◆ GetTreeByPath()

const BehaviorTreeAsset * BehaviorTreeManager::GetTreeByPath ( const std::string &  treePath) const
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 905 of file BehaviorTree.cpp.

References GetComponentTypeID_Static(), GetTree(), and GetTreeIdFromPath().

Referenced by BehaviorTreeSystem::Process().

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

◆ GetTreeIdFromPath()

uint32_t BehaviorTreeManager::GetTreeIdFromPath ( const std::string &  treePath) const

◆ GetTreePathFromId()

std::string BehaviorTreeManager::GetTreePathFromId ( uint32_t  treeId) const

◆ GetValidationErrors()

std::vector< std::string > BehaviorTreeManager::GetValidationErrors ( uint32_t  graphId)
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 1527 of file BehaviorTree.cpp.

References DetectCircularDependencies(), GetComponentTypeID_Static(), GetTree(), SubGraph, and ValidateSubGraphPath().

Referenced by Olympe::BTNodePropertyPanel::RenderSubGraphControls().

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

◆ IsTreeLoadedByPath()

bool BehaviorTreeManager::IsTreeLoadedByPath ( const std::string &  treePath) const
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 900 of file BehaviorTree.cpp.

References m_pathToIdMap.

Referenced by DetectCircularDependencies(), and World::LoadLevelDependencies().

+ Here is the caller graph for this function:

◆ LoadTreeFromFile()

bool BehaviorTreeManager::LoadTreeFromFile ( const std::string &  filepath,
uint32_t  treeId 
)

◆ ReloadTree()

bool BehaviorTreeManager::ReloadTree ( uint32_t  treeId)

◆ ValidateSubGraphPath()

bool BehaviorTreeManager::ValidateSubGraphPath ( const std::string &  path) const
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 1408 of file BehaviorTree.cpp.

References GetComponentTypeID_Static(), JsonHelper::LoadJsonFromFile(), and SYSTEM_LOG.

Referenced by DetectCircularDependencies(), and GetValidationErrors().

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

◆ ValidateTree()

bool BehaviorTreeManager::ValidateTree ( const BehaviorTreeAsset tree,
std::string &  errorMessage 
) const
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/AI/BehaviorTree.h.

Definition at line 379 of file BehaviorTree.cpp.

References GetComponentTypeID_Static(), Inverter, BTNode::name, Repeater, Selector, and Sequence.

Referenced by LoadTreeFromFile().

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

Member Data Documentation

◆ m_pathToIdMap

std::map<std::string, uint32_t> BehaviorTreeManager::m_pathToIdMap
private

◆ m_trees

std::vector<BehaviorTreeAsset> BehaviorTreeManager::m_trees
private

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