![]() |
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 |
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 244 of file BehaviorTree.h.
|
privatedefault |
| void BehaviorTreeManager::Clear | ( | ) |
Definition at line 291 of file BehaviorTree.cpp.
References m_pathToIdMap, and m_trees.
| void BehaviorTreeManager::DebugPrintLoadedTrees | ( | ) | const |
Definition at line 873 of file BehaviorTree.cpp.
References GetComponentTypeID_Static(), m_pathToIdMap, and m_trees.
Referenced by Olympe::BehaviorTreeDebugWindow::RefreshEntityList(), Olympe::BehaviorTreeDebugWindow::RenderNodeGraphPanel(), and Olympe::BehaviorTreeDebugWindow::RenderRuntimeInfo().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Definition at line 247 of file BehaviorTree.h.
References GetComponentTypeID_Static().
Referenced by Olympe::BehaviorTreeDebugWindow::HandleNodeCreation(), PrefabFactory::InstantiateBehaviorTreeRuntime(), World::LoadLevelDependencies(), BehaviorTreeSystem::Process(), Olympe::BehaviorTreeDebugWindow::RefreshEntityList(), Olympe::BehaviorTreeDebugWindow::RenderBehaviorTreeGraph(), Olympe::BehaviorTreeDebugWindow::RenderEntityEntry(), Olympe::BehaviorTreeDebugWindow::RenderInSeparateWindow(), Olympe::BehaviorTreeDebugWindow::RenderNodeGraphPanel(), Olympe::BehaviorTreeDebugWindow::RenderRuntimeInfo(), and Olympe::BehaviorTreeDebugWindow::ResetZoom().
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 281 of file BehaviorTree.cpp.
References GetComponentTypeID_Static(), and m_trees.
Referenced by GetTreeByPath(), 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 839 of file BehaviorTree.cpp.
References GetComponentTypeID_Static(), and m_trees.
Referenced by Olympe::BehaviorTreeDebugWindow::HandleNodeCreation(), BehaviorTreeSystem::Process(), Olympe::BehaviorTreeDebugWindow::RefreshEntityList(), Olympe::BehaviorTreeDebugWindow::RenderBehaviorTreeGraph(), Olympe::BehaviorTreeDebugWindow::RenderEntityEntry(), Olympe::BehaviorTreeDebugWindow::RenderInSeparateWindow(), Olympe::BehaviorTreeDebugWindow::RenderNodeGraphPanel(), Olympe::BehaviorTreeDebugWindow::RenderRuntimeInfo(), and Olympe::BehaviorTreeDebugWindow::ResetZoom().
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 833 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 817 of file BehaviorTree.cpp.
References BehaviorTreeDependencyScanner::GenerateTreeIdFromPath(), GetComponentTypeID_Static(), and m_pathToIdMap.
Referenced by 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 854 of file BehaviorTree.cpp.
References GetComponentTypeID_Static(), m_pathToIdMap, m_trees, and BehaviorTreeAsset::name.
Referenced by Olympe::BehaviorTreeDebugWindow::RefreshEntityList(), Olympe::BehaviorTreeDebugWindow::RenderNodeGraphPanel(), and Olympe::BehaviorTreeDebugWindow::RenderRuntimeInfo().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 828 of file BehaviorTree.cpp.
References m_pathToIdMap.
Referenced by World::LoadLevelDependencies().
Here is the caller graph for this function:Definition at line 29 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, PatrolPickNextPoint, Repeater, RequestPathfinding, Selector, Sequence, SetMoveGoalToLastKnownTargetPos, SetMoveGoalToPatrolPoint, SetMoveGoalToTarget, TargetInRange, TargetVisible, ValidateTree(), and WaitRandomTime.
Referenced by World::LoadLevelDependencies(), and ReloadTree().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 297 of file BehaviorTree.cpp.
References GetComponentTypeID_Static(), LoadTreeFromFile(), m_trees, BehaviorTreeAsset::name, and SYSTEM_LOG.
Here is the call graph for this function:| bool BehaviorTreeManager::ValidateTree | ( | const BehaviorTreeAsset & | tree, |
| std::string & | errorMessage | ||
| ) | const |
Definition at line 327 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 291 of file BehaviorTree.h.
Referenced by Clear(), DebugPrintLoadedTrees(), GetTreeIdFromPath(), GetTreePathFromId(), IsTreeLoadedByPath(), and LoadTreeFromFile().
|
private |
Definition at line 288 of file BehaviorTree.h.
Referenced by Clear(), DebugPrintLoadedTrees(), GetTree(), GetTreeByAnyId(), GetTreePathFromId(), LoadTreeFromFile(), and ReloadTree().