当前位置:网站首页>Introduction to common classes on the runtime side
Introduction to common classes on the runtime side
2022-06-26 09:06:00 【LixiSchool】
https://www.behaviac.com/basic_classes/
In the use of behaviac Runtime end (Runtime) Source code or API when , There are a few of the most commonly used classes worth noting : Such as Workspace、Agent、Config etc. .
Workspace class
Workspace Class is mainly used to manage the export of type information , load 、 uninstall 、 perform 、 Stop executing the behavior tree , Set the time, frame number, etc .
- GetInstance() : Used to get Workspace Single instance of .
- ExportMetas(const char*) : Export the type information file to the specified path , See documentation 《C++ Registration and export of type information in the runtime side 》.
- SetFilePath(const char*) : Used to specify the directory where the behavior tree file is located when loading the behavior tree .
- SetFileFormat(EFileFormat) : Used to specify the format of the loading behavior tree file , Include Xml、Bson、Cpp/Cs、Default. among Default Means to try to load first Xml Format , If not, try loading again Bson Format , Finally, try loading Cpp/Cs Format , This function can be used for hot update of behavior tree .
- Update() : Used to perform all Agent Current behavior tree for , The behavior tree can also be executed without passing the API, You can call it by yourself Agent Of btexec() Method , See documentation 《 The update process on the runtime side 》.
- DebugUpdate() : Methods for performing debugging and hot loading , If already used Update() Method to execute , It is not necessary to call this... During continuous debugging or hot loading DebugUpdate() Method .
- SetIsExecAgents(bool) : Used to stop / Continue with all Agent Current behavior tree for , The premise is that the behavior tree is implemented through Update() Method initiated . If it is called by itself Agent Of btexec() Method , Through Agent Of SetActive(bool) Method to stop / Carry on .
- SetTimeSinceStartup(double) : Used to set the total time of the game from start to current , This total time is mainly used for time 、 Waiting time and other time-related node execution . If you do not set this value every frame , These nodes will not work properly .
- SetFrameSinceStartup(int) : Used to set the total number of frames of the game from start to current , This total number of frames is mainly used for the number of frames 、 Wait for the execution of nodes related to the number of frames, such as the number of frames . If you do not set this value every frame , These nodes will not work properly .
The specific code can be viewed behaviac/base/workspace.h
Agent class
Static methods :
- Create(const char*, int, short) : Used to create Agent Example .
- Destroy(Agent*) : Used to destroy Agent Example .
- Register() : Register the Agent class , Used to record the type information of this class .
- UnRegister() : Unregister the Agent class .
- RegisterInstanceName(const char*, const wchar_t*, const wchar_t*) : Register instance name , As part of the type information , After export, it can be used to configure nodes in the editor .
- UnRegisterInstanceName(const char*) : Unregister instance name .
- BindInstance(Agent*, const char*, int) : Will be a Agent Instance is bound to a name .
- UnbindInstance(const char*, int) : Cancel a certain Agent The binding of an instance to a name .
Member method :
- btload(const char*, bool) : Used to load the behavior tree with the specified name , No suffix is required ( File format ).
- btunload(const char*) : Used to unload the behavior tree with the specified name .
- btsetcurrent(const char*) : Used to set the current behavior tree .
- btexec() : Execute the current behavior tree .
- SetActive(bool) : Used to stop / Continue executing the current behavior tree , If set to false, Indicates to stop executing the current behavior tree ; otherwise , Indicates continued execution .
- FireEvent(const char*) : Used to issue events , So that the events bound in the behavior tree can be responded .
- SetIdFlag(uint32_t) : This node is used to set whether to track this... During continuous debugging Agent. By static method SetIdMask() Set all Agent Of Mask value , And then through SetIdFlag() Set up current Agent Of Flag value . If IsMasked() Return to true , Indicates that the Agent.
- SetName(const char*) : Used to set the name .
The specific code can be viewed behaviac/agent/agent.h
Config class
See documentation 《 Development function switch 》.
边栏推荐
- 1.20 study univariate linear regression
- docker安装redis
- Clion installation + MinGW configuration + opencv installation
- 1.Intro_ Math (white board derivation and reprint of station B)
- [300+ continuous sharing of selected interview questions from large manufacturers] column on interview questions of big data operation and maintenance (I)
- Backward usage
- 反爬之验证码识别登录 (OCR字符识别)
- Implementation code of interceptor and filter
- Code de mise en œuvre de l'intercepteur et du filtre
- 【300+精选大厂面试题持续分享】大数据运维尖刀面试题专栏(一)
猜你喜欢

外部排序和大小堆相关知识

The solution of positioning failure caused by framework jump

Segmentation of structured light images using segmentation network

Yolov5 advanced III training environment

什么是乐观锁,什么是悲观锁

Notes on setting qccheckbox style

Fix the problem that the rich text component of the applet does not support the properties of video cover, autoplay, controls, etc

phpcms小程序插件4.0版正式上线

爬虫 对 Get/Post 请求时遇到编码问题的解决方案

【300+精选大厂面试题持续分享】大数据运维尖刀面试题专栏(一)
随机推荐
深度学习论文阅读目标检测篇(七)中文版:YOLOv4《Optimal Speed and Accuracy of Object Detection》
isinstance()函数用法
浅谈一下Type-C接口发展历程
Checkerboard generation + camera calibration + stereo matching
[IVI] 15.1.2 system stability optimization (lmkd Ⅱ) psi pressure stall information
修复小程序富文本组件不支持video视频封面、autoplay、controls等属性问题
uniapp用uParse实现解析后台的富文本编辑器的内容及修改uParse样式
[qnx hypervisor 2.2 user manual]12.1 terminology (I)
[qnx hypervisor 2.2 user manual]12.2 terminology (II)
小程序实现图片预加载(图片延迟加载)
1.21 study gradient descent and normal equation
ThreadLocal
ThreadLocal
百度小程序富文本解析工具bdParse
How to use the least money to quickly open the Taobao traffic portal?
上下架和橱窗推荐如何设置,优化过程需要注意的地方
Segmentation of structured light images using segmentation network
Yolov5进阶之二安装labelImg
Yolov5进阶之四训练自己的数据集
[300+ continuous sharing of selected interview questions from large manufacturers] column on interview questions of big data operation and maintenance (I)