![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
#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 BehaviorTreeAsset * | GetTree (uint32_t treeId) const |
| void | Clear () |
| uint32_t | GetTreeIdFromPath (const std::string &treePath) const |
| bool | IsTreeLoadedByPath (const std::string &treePath) const |
| const BehaviorTreeAsset * | GetTreeByPath (const std::string &treePath) const |
| const BehaviorTreeAsset * | GetTreeByAnyId (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 BehaviorTreeManager & | Get () |
Private Member Functions | |
| BehaviorTreeManager ()=default | |
Private Attributes | |
| std::vector< BehaviorTreeAsset > | m_trees |
| std::map< std::string, uint32_t > | m_pathToIdMap |
Definition at line 376 of file BehaviorTree.h.
|
privatedefault |
| void BehaviorTreeManager::Clear | ( | ) |
Definition at line 343 of file BehaviorTree.cpp.
References m_pathToIdMap, and m_trees.
| void BehaviorTreeManager::DebugPrintLoadedTrees | ( | ) | const |
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:| bool BehaviorTreeManager::DetectCircularDependencies | ( | uint32_t | graphId, |
| uint32_t | nodeId, | ||
| const BehaviorTreeAsset * | parentTree, | ||
| std::set< std::string > & | visited | ||
| ) |
Definition at line 1460 of file BehaviorTree.cpp.
References DetectCircularDependencies(), GetComponentTypeID_Static(), GetTreeByAnyId(), IsTreeLoadedByPath(), LoadTreeFromFile(), SubGraph, BTNode::subgraphPath, SYSTEM_LOG, and ValidateSubGraphPath().
Referenced by DetectCircularDependencies(), and GetValidationErrors().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Definition at line 379 of file BehaviorTree.h.
References GetComponentTypeID_Static().
Referenced by PrefabFactory::CreateEntityFromBlueprint(), PrefabFactory::CreateEntityWithOverrides(), Olympe::BehaviorTreeExecutor::ExecuteSubGraph(), Olympe::NodeGraphShared::BTGraphDocumentConverter::FromBehaviorTree(), PrefabFactory::InstantiateBehaviorTreeRuntime(), World::LoadLevelDependencies(), BehaviorTreeSystem::Process(), Olympe::BehaviorTreeDebugWindow::RefreshEntityList(), Olympe::BehaviorTreeDebugWindow::RenderNodeGraphDebugPanel(), Olympe::BehaviorTreeDebugWindow::RenderRuntimeInfo(), and Olympe::BTNodePropertyPanel::RenderSubGraphControls().
Here is the call graph for this function:
Here is the caller graph for this function:| const BehaviorTreeAsset * BehaviorTreeManager::GetTree | ( | uint32_t | treeId | ) | const |
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:| const BehaviorTreeAsset * BehaviorTreeManager::GetTreeByAnyId | ( | uint32_t | treeId | ) | const |
Definition at line 911 of file BehaviorTree.cpp.
References GetComponentTypeID_Static(), and m_trees.
Referenced by DetectCircularDependencies(), Olympe::BehaviorTreeExecutor::ExecuteSubGraph(), BehaviorTreeSystem::Process(), Olympe::BehaviorTreeDebugWindow::RefreshEntityList(), Olympe::BehaviorTreeDebugWindow::RenderNodeGraphDebugPanel(), and Olympe::BehaviorTreeDebugWindow::RenderRuntimeInfo().
Here is the call graph for this function:
Here is the caller graph for this function:| const BehaviorTreeAsset * BehaviorTreeManager::GetTreeByPath | ( | const std::string & | treePath | ) | const |
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:Definition at line 889 of file BehaviorTree.cpp.
References BehaviorTreeDependencyScanner::GenerateTreeIdFromPath(), GetComponentTypeID_Static(), and m_pathToIdMap.
Referenced by PrefabFactory::CreateEntityFromBlueprint(), PrefabFactory::CreateEntityWithOverrides(), GetTreeByPath(), and PrefabFactory::InstantiateBehaviorTreeRuntime().
Here is the call graph for this function:
Here is the caller graph for this function:| std::string BehaviorTreeManager::GetTreePathFromId | ( | uint32_t | treeId | ) | const |
Definition at line 926 of file BehaviorTree.cpp.
References GetComponentTypeID_Static(), m_pathToIdMap, m_trees, and BehaviorTreeAsset::name.
Referenced by Olympe::NodeGraphShared::BTGraphDocumentConverter::FromBehaviorTree(), Olympe::BehaviorTreeDebugWindow::RefreshEntityList(), and Olympe::BehaviorTreeDebugWindow::RenderRuntimeInfo().
Here is the call graph for this function:
Here is the caller graph for this function:| std::vector< std::string > BehaviorTreeManager::GetValidationErrors | ( | uint32_t | graphId | ) |
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: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:Definition at line 31 of file BehaviorTree.cpp.
References Action, AttackIfClose, CanAttack, ChooseRandomNavigablePoint, ClearTarget, Condition, FollowPath, JsonHelper::ForEachInArray(), GetComponentTypeID_Static(), JsonHelper::GetFloat(), JsonHelper::GetInt(), JsonHelper::GetString(), JsonHelper::GetUInt(), HasMoveGoal, HasNavigableDestination, HasReachedDestination, HasValidPath, HealthBelow, HeardNoise, BTNode::id, BehaviorTreeAsset::id, Idle, Inverter, JsonHelper::IsArray(), IsWaitTimerExpired, JsonHelper::LoadJsonFromFile(), m_pathToIdMap, m_trees, MoveToGoal, OnEvent, PatrolPickNextPoint, Repeater, RequestPathfinding, Root, Selector, Sequence, SetMoveGoalToLastKnownTargetPos, SetMoveGoalToPatrolPoint, SetMoveGoalToTarget, SubGraph, TargetInRange, TargetVisible, ValidateTree(), and WaitRandomTime.
Referenced by DetectCircularDependencies(), Olympe::BehaviorTreeExecutor::ExecuteSubGraph(), World::LoadLevelDependencies(), and ReloadTree().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 349 of file BehaviorTree.cpp.
References GetComponentTypeID_Static(), LoadTreeFromFile(), m_trees, BehaviorTreeAsset::name, and SYSTEM_LOG.
Here is the call graph for this function: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:| bool BehaviorTreeManager::ValidateTree | ( | const BehaviorTreeAsset & | tree, |
| std::string & | errorMessage | ||
| ) | const |
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:
|
private |
Definition at line 436 of file BehaviorTree.h.
Referenced by Clear(), DebugPrintLoadedTrees(), GetTreeIdFromPath(), GetTreePathFromId(), IsTreeLoadedByPath(), and LoadTreeFromFile().
|
private |
Definition at line 433 of file BehaviorTree.h.
Referenced by Clear(), DebugPrintLoadedTrees(), GetTree(), GetTreeByAnyId(), GetTreePathFromId(), LoadTreeFromFile(), and ReloadTree().