![]() |
Botcraft 1.21.4
|
#include <BehaviourRenderer.hpp>
Public Member Functions | |
BehaviourRenderer () | |
~BehaviourRenderer () | |
void | Init () |
void | RenderNodes () |
void | RenderBlackboard () |
void | CleanUp () |
void | SetCurrentBehaviourTree (const BaseNode *root) |
void | ResetBehaviourState () |
void | BehaviourStartTick () |
void | BehaviourEndTick (const bool b) |
void | BehaviourTickChild (const size_t i) |
bool | IsBehaviourPaused () const |
void | ResetBlackboard () |
void | UpdateBlackboardValue (const std::string &key, const std::any &value) |
void | RemoveBlackboardValue (const std::string &key) |
Private Member Functions | |
void | RenderNode (const size_t index) |
void | NavigateToActiveNode () const |
Private Attributes | |
ax::NodeEditor::EditorContext * | context |
std::unique_ptr< ax::NodeEditor::Config > | config |
std::vector< std::unique_ptr< ImNode > > | nodes |
std::mutex | nodes_mutex |
ImNode * | active_node |
bool | recompute_node_position |
bool | paused |
bool | step |
ProtocolCraft::Json::Value | blackboard |
std::mutex | blackboard_mutex |
Definition at line 31 of file BehaviourRenderer.hpp.
Botcraft::Renderer::BehaviourRenderer::BehaviourRenderer | ( | ) |
Definition at line 83 of file BehaviourRenderer.cpp.
Botcraft::Renderer::BehaviourRenderer::~BehaviourRenderer | ( | ) |
Definition at line 90 of file BehaviourRenderer.cpp.
void Botcraft::Renderer::BehaviourRenderer::BehaviourEndTick | ( | const bool | b | ) |
Definition at line 414 of file BehaviourRenderer.cpp.
References active_node, Botcraft::Renderer::Failure, nodes_mutex, Botcraft::Renderer::ImNode::parent, Botcraft::Renderer::ImNode::status, and Botcraft::Renderer::Success.
void Botcraft::Renderer::BehaviourRenderer::BehaviourStartTick | ( | ) |
Definition at line 378 of file BehaviourRenderer.cpp.
References active_node, context, Botcraft::Renderer::ImNode::id, NavigateToActiveNode(), nodes_mutex, paused, Botcraft::Renderer::Running, Botcraft::Renderer::ImNode::status, step, and Botcraft::Renderer::ImNode::visible.
void Botcraft::Renderer::BehaviourRenderer::BehaviourTickChild | ( | const size_t | i | ) |
Definition at line 427 of file BehaviourRenderer.cpp.
References active_node, Botcraft::Renderer::ImNode::children, and nodes_mutex.
void Botcraft::Renderer::BehaviourRenderer::CleanUp | ( | ) |
Definition at line 343 of file BehaviourRenderer.cpp.
References active_node, config, context, nodes, nodes_mutex, paused, recompute_node_position, ResetBlackboard(), and step.
void Botcraft::Renderer::BehaviourRenderer::Init | ( | ) |
Definition at line 95 of file BehaviourRenderer.cpp.
References config, context, nodes_mutex, and ResetBlackboard().
bool Botcraft::Renderer::BehaviourRenderer::IsBehaviourPaused | ( | ) | const |
Definition at line 436 of file BehaviourRenderer.cpp.
References nodes_mutex, and paused.
|
private |
Definition at line 575 of file BehaviourRenderer.cpp.
References active_node, and Botcraft::Renderer::ImNode::id.
Referenced by BehaviourStartTick().
void Botcraft::Renderer::BehaviourRenderer::RemoveBlackboardValue | ( | const std::string & | key | ) |
Definition at line 1051 of file BehaviourRenderer.cpp.
References blackboard, BLACKBOARD_HIGHLIGHT_DURATION, blackboard_mutex, ProtocolCraft::Json::Value::get_object(), and Botcraft::Utilities::SplitString().
void Botcraft::Renderer::BehaviourRenderer::RenderBlackboard | ( | ) |
Definition at line 336 of file BehaviourRenderer.cpp.
References blackboard, blackboard_mutex, Botcraft::Renderer::RecursiveRenderBlackboardJsonNode(), and Botcraft::Renderer::RecursiveUpdateTimerBlackboardJsonNode().
|
private |
Definition at line 442 of file BehaviourRenderer.cpp.
References Botcraft::Renderer::ImNode::children, Botcraft::Renderer::ImNode::classname, Botcraft::Renderer::GetNodeColor(), Botcraft::Renderer::GetStatusColor(), Botcraft::Renderer::ImNode::id, Botcraft::Renderer::ImNode::in_attr_id, MIN_NODE_WIDTH, Botcraft::Renderer::ImNode::name, nodes, Botcraft::Renderer::ImNode::out_attr_ids, PIN_RADIUS, recompute_node_position, Botcraft::Renderer::ImNode::status, Botcraft::Renderer::ToggleNodeVisibility(), Botcraft::Renderer::ImNode::type, Botcraft::Renderer::ImNode::visible, Botcraft::Renderer::ImNode::x, and Botcraft::Renderer::ImNode::y.
Referenced by RenderNodes().
void Botcraft::Renderer::BehaviourRenderer::RenderNodes | ( | ) |
Definition at line 111 of file BehaviourRenderer.cpp.
References context, Botcraft::Renderer::GetStatusColor(), LINK_THICKNESS, nodes, nodes_mutex, paused, Botcraft::Renderer::PlaceNodesBuchheim(), recompute_node_position, RenderNode(), Botcraft::Renderer::Running, and step.
void Botcraft::Renderer::BehaviourRenderer::ResetBehaviourState | ( | ) |
Definition at line 367 of file BehaviourRenderer.cpp.
References active_node, Botcraft::Renderer::Idle, nodes, and nodes_mutex.
void Botcraft::Renderer::BehaviourRenderer::ResetBlackboard | ( | ) |
Definition at line 996 of file BehaviourRenderer.cpp.
References blackboard, BLACKBOARD_HIGHLIGHT_DURATION, and blackboard_mutex.
void Botcraft::Renderer::BehaviourRenderer::SetCurrentBehaviourTree | ( | const BaseNode * | root | ) |
Definition at line 360 of file BehaviourRenderer.cpp.
References nodes, nodes_mutex, recompute_node_position, and Botcraft::Renderer::UnrollTreeStructure().
void Botcraft::Renderer::BehaviourRenderer::UpdateBlackboardValue | ( | const std::string & | key, |
const std::any & | value | ||
) |
Definition at line 1002 of file BehaviourRenderer.cpp.
References blackboard, BLACKBOARD_HIGHLIGHT_DURATION, blackboard_mutex, Botcraft::Utilities::SplitString(), and Botcraft::Utilities::AnyParser::ToString().
|
private |
Definition at line 63 of file BehaviourRenderer.hpp.
Referenced by BehaviourEndTick(), BehaviourStartTick(), BehaviourTickChild(), CleanUp(), NavigateToActiveNode(), and ResetBehaviourState().
|
private |
Definition at line 68 of file BehaviourRenderer.hpp.
Referenced by RemoveBlackboardValue(), RenderBlackboard(), ResetBlackboard(), and UpdateBlackboardValue().
|
mutableprivate |
Definition at line 69 of file BehaviourRenderer.hpp.
Referenced by RemoveBlackboardValue(), RenderBlackboard(), ResetBlackboard(), and UpdateBlackboardValue().
|
private |
Definition at line 59 of file BehaviourRenderer.hpp.
|
private |
Definition at line 58 of file BehaviourRenderer.hpp.
Referenced by BehaviourStartTick(), CleanUp(), Init(), and RenderNodes().
|
private |
Definition at line 60 of file BehaviourRenderer.hpp.
Referenced by CleanUp(), RenderNode(), RenderNodes(), ResetBehaviourState(), and SetCurrentBehaviourTree().
|
mutableprivate |
Definition at line 61 of file BehaviourRenderer.hpp.
Referenced by BehaviourEndTick(), BehaviourStartTick(), BehaviourTickChild(), CleanUp(), Init(), IsBehaviourPaused(), RenderNodes(), ResetBehaviourState(), and SetCurrentBehaviourTree().
|
private |
Definition at line 65 of file BehaviourRenderer.hpp.
Referenced by BehaviourStartTick(), CleanUp(), IsBehaviourPaused(), and RenderNodes().
|
private |
Definition at line 64 of file BehaviourRenderer.hpp.
Referenced by CleanUp(), RenderNode(), RenderNodes(), and SetCurrentBehaviourTree().
|
private |
Definition at line 66 of file BehaviourRenderer.hpp.
Referenced by BehaviourStartTick(), CleanUp(), and RenderNodes().