当前位置:网站首页>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 》.
边栏推荐
- 百度小程序富文本解析工具bdParse
- 1.20 study univariate linear regression
- 在哪个软件上开户比较安全
- MySQL在服务里找不到(未卸载)
- [QNX Hypervisor 2.2用户手册]12.1 术语(一)
- Drawing with MATLAB (2) -- color ring
- Fix the problem that the rich text component of the applet does not support the properties of video cover, autoplay, controls, etc
- 1.26 pytorch learning
- MySQL cannot be found in the service (not uninstalled)
- 隐藏式列表菜单以及窗口转换在Selenium 中的应用
猜你喜欢

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

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

yolov5进阶之零环境快速创建及测试

Games104 Lecture 12 游戏引擎中的粒子和声效系统

Reverse crawling verification code identification login (OCR character recognition)

XSS cross site scripting attack

Yolov5进阶之一摄像头实时采集识别

20220623 getting started with Adobe Illustrator

教程1:Hello Behaviac

Drawing with MATLAB (1)
随机推荐
1.26 pytorch learning
Phpcms applet interface new universal interface get_ diy. php
ImportError: ERROR: recursion is detected during loading of “cv2“ binary extensions. Check OpenCV in
反爬之验证码识别登录 (OCR字符识别)
phpcms小程序插件4.0版正式上线
【程序的编译和预处理】
Particles and sound effect system in games104 music 12 game engine
Applet realizes picture preloading (picture delayed loading)
Sqoop merge usage
Regular Expression 正则表达式
[IVI] 15.1.2 system stability optimization (lmkd Ⅱ) psi pressure stall information
Yolov5 advanced III training environment
Yolov5 advanced 5 GPU environment setup
浅谈一下Type-C接口发展历程
Dedecms applet plug-in is officially launched, and one click installation does not require any PHP or SQL Foundation
The solution of positioning failure caused by framework jump
phpcms v9后台增加阅读量字段,可任意修改阅读量
Selenium 搭建 Cookies池 绕过验证反爬登录
小程序首页加载之前加载其他相关资源或配置(小程序的promise应用)
[program compilation and pretreatment]