ngl_server 1.0
基于 Actor 模型的 C++ 服务器框架
ngl::nbt_action_node< TACTOR > Class Template Referencefinal

同步动作节点包装类。 More...

#include <nbt.h>

Inheritance diagram for ngl::nbt_action_node< TACTOR >:

Public Member Functions

 nbt_action_node (const std::string &aname, const BT::NodeConfig &aconfig, nbt_node_callback< TACTOR > afun)
 构造函数。
nbt_status tick () override
 执行节点tick。

Detailed Description

template<typename TACTOR>
class ngl::nbt_action_node< TACTOR >

同步动作节点包装类。

继承自BT::SyncActionNode,将节点回调函数包装为行为树节点。 tick()方法从黑板获取上下文,调用用户注册的回调函数。

Template Parameters
TACTORActor类型
Note
回调函数在tick()调用期间同步执行并立即返回结果。

Constructor & Destructor Documentation

◆ nbt_action_node()

template<typename TACTOR>
ngl::nbt_action_node< TACTOR >::nbt_action_node ( const std::string & aname,
const BT::NodeConfig & aconfig,
nbt_node_callback< TACTOR > afun )
inline

构造函数。

Parameters
aname节点实例名称
aconfig节点配置(含黑板引用)
afun用户注册的回调函数

Member Function Documentation

◆ tick()

template<typename TACTOR>
nbt_status ngl::nbt_action_node< TACTOR >::tick ( )
inlineoverride

执行节点tick。

从黑板中获取nbt_context指针,调用用户回调函数。

Returns
节点执行状态

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