MCPcopy Create free account
hub / github.com/BehaviorTree/BehaviorTree.CPP / checkPostConditions

Method checkPostConditions

src/tree_node.cpp:261–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259}
260
261void TreeNode::checkPostConditions(NodeStatus status)
262{
263 auto ExecuteScript = [this](const PostCond& cond) {
264 const auto& parse_executor = _p->post_parsed[size_t(cond)];
265 if(parse_executor)
266 {
267 Ast::Environment env = { config().blackboard, config().enums };
268 parse_executor(env);
269 }
270 };
271
272 if(status == NodeStatus::SUCCESS)
273 {
274 ExecuteScript(PostCond::ON_SUCCESS);
275 }
276 else if(status == NodeStatus::FAILURE)
277 {
278 ExecuteScript(PostCond::ON_FAILURE);
279 }
280 ExecuteScript(PostCond::ALWAYS);
281}
282
283void TreeNode::resetStatus()
284{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected