当前位置:网站首页>Edit type information
Edit type information
2022-06-26 09:13:00 【LixiSchool】
https://www.behaviac.com/edit_types/
In the type information browser , Manage all created type information .
After creating the type information , We may need to continue to modify in the type information browser 、 Delete the previously created type information , Such as class and member attributes 、 Such method .
type
There are three types of :Agent、Struct and Enum, When adding a new type , You can choose accordingly , As shown in the figure below :

On the left side of the type information browser “ Type list ” Select the... You want to edit Agent Subclass , On the right side of the “ type ” In the attribute box , Relevant parameters can be modified , As shown in the figure below :

“ type ” The parameters in the box are described as follows :
- The generated code : Indicates whether the type needs to be in the lower right corner “ application ” Button , Generate source code files
- name : The name of the type , Follow C++/C# The variable naming requirements of are consistent , Illegal characters cannot be entered
- Namespace : The namespace of the type , Follow C++/C# The namespace of is consistent
- Base class : Base class of this type
- Reference type : Whether the type is a reference type , It is mainly provided for structure type . If it's a reference type , When used in the editor , Can only be used as a reference or pointer , Cannot expand configuration of its member properties .Agent Subclasses are all reference types , The structure type can be selected as reference or non reference type , Enumeration types are all non reference types
- Generation location : In general, there is no need to set , By default, the... Configured in the workspace will be used uniformly “ Code generation location ”. But if this parameter is set , Indicates that the current type will be generated in the specified directory
- Display name : Used to display the name of the type in the editor , It can be in Chinese
- describe : Used to display the description of this type in the editor , It can be in Chinese
The buttons on the upper right are described below :
- newly added : Used to add a new type
- Delete : Used to delete the selected type
- Preview prototype code : Used to preview the generated code content . If the above... Is not checked “ type ” In the box “ The generated code ” Options , You can click this button to open the prototype code file , Copy relevant content into your own code
- Set header file : In the code automatically generated by the editor , You may need to include header files in your project , Then you need to click this button , eject “C++ Export settings ” Add the required header file to the window , As shown in the figure below :

example
In the middle of the type information browser “ Instance name ” In the list , Lists the currently selected Agent All global instance names of subclasses .
On its right “ newly added ” Button to add an instance name ,“ Delete ” Button to delete the currently selected instance name , As shown in the figure below :
![]()
In the document 《 Lesson three :Agent example 》 in , There are detailed instructions for using the example .
member
In the lower part of the type information browser “ Member type ” It is divided into Property、Method and Task:
- Property: Member attribute
- Method: Member method
- Task: Mission , The interface prototype used to define the subtree call
attribute
“ Member list ” According to the... Selected above “ Member type ”, Lists all members ;“ Filter characters ” Used to enumerate all members with their own specified characters , That is, quickly retrieve the members you need , As shown in the figure below :

Select an attribute , It can be in the following “ attribute ” Box to view various parameters of this attribute :
- name : The name of the attribute , Follow C++/C# The variable naming requirements of are consistent , Illegal characters cannot be entered
- type : The type of the property . If you check the following “ Array ?”, Indicates that the type is array type
- Open : Whether the attribute is public, Follow C++/C# The concepts in are the same
- static state : Whether the attribute is static, Follow C++/C# The concepts in are the same
- read-only : Whether the attribute is read-only . If it's read-only , Then in the assignment node , Cannot be assigned as an lvalue , Only this value can be read
- local variable : Indicates whether the attribute is a local variable . If it's a local variable , Only use in the currently open behavior tree , otherwise , Is a common member property , Belongs to current Agent Subclass , Can be used for any behavior tree
- The default value is : The default initial value of this attribute , Will be automatically generated in the constructor of the type
- Display name : Used to display the name of the attribute in the editor , It can be in Chinese
- describe : Used to display the description of the attribute in the editor , It can be in Chinese
On the right side of the “ newly added ” Button to add a new attribute ,“ Delete ” The button is used to delete the selected attribute ,“ Upward ” and “ Down ” Button is used to adjust the relative position of the selected attribute .
Method
In the type information browser , take “ Member type ” Choose as “Method”, It's in “ Member list ” All member methods are listed in , As shown in the figure below :

After selecting a method , It can be in the following “ attribute ” Box to view the various parameters of the method :
- name : The name of the method , Follow C++/C# The variable naming requirements of are consistent , Illegal characters cannot be entered
- return type : The return value type of this method . If you check the following “ Array ?”, Indicates that the type is array type
- Open : Whether the method is public, Follow C++/C# The concepts in are the same
- static state : Whether the method is static, Follow C++/C# The concepts in are the same
- Display name : Used to display the name of the method in the editor , It can be in Chinese
- describe : Used to display the description of the method in the editor , It can be in Chinese
- Parameters : The parameter list of this method , You can add and delete
Mission
In the type information browser , take “ Member type ” Choose as “Task”, It's in “ Member list ” All tasks are listed in , As shown in the figure below :

The editing of tasks is the same as that of member methods , The task just defines an interface prototype , Parameter passing for events . More usage of events , Please refer to the article 《 Event handling 》.
Last , In the process of editing type information , Don't forget to click... At the bottom right “ application ” Button , Save and generate type information .
The generated code
After editing the type information , Click... At the bottom right “ Apply button ” Generate source files related to type information .
If the above Agent type “FirstAgent” Checked “ The generated code ” Options , So in it “ Generation location ” in , This type of source file will be automatically generated ( Click on the bottom left “ Open the code generation location ” Button ), As shown in the figure below :

There is also a case that Agent Type is not checked “ The generated code ” Options , Or the old version , Are written by programmers by hand Agent type . Then click on the “ application ” After button , You need to manually add the code of member properties or methods added in the type information browser on the program side .
In order to improve the efficiency and accuracy of manual coding , Click on “ Preview prototype code ” Button , As shown in the figure below :

You can see the current Agent The prototype code for the class is as follows , You can copy and paste the definitions of the required member properties or methods into your own code :

If you forget to add the corresponding member property or method on the program side , When compiling, you will also report that you cannot find these new member properties or methods added in the editor , You need to add it manually .
边栏推荐
猜你喜欢

浅谈一下Type-C接口发展历程

Application of hidden list menu and window transformation in selenium

Live review | smardaten lihongfei interprets the Research Report on China's low / no code industry: the wind direction has changed

【开源】使用PhenoCV-WeedCam进行更智能、更精确的杂草管理

External sorting and heap size knowledge

Yolov5进阶之三训练环境

51 single chip microcomputer ROM and ram

Yolov5 advanced III training environment

Phpcms V9 remove the phpsso module

Phpcms mobile station module implements custom pseudo static settings
随机推荐
Application of hidden list menu and window transformation in selenium
How to use the least money to quickly open the Taobao traffic portal?
[300+ continuous sharing of selected interview questions from large manufacturers] column on interview questions of big data operation and maintenance (I)
Bug encountered in training detectron2: the test set cannot be evaluated during training
phpcms小程序插件教程网站正式上线
《單片機原理及應用》——概述
Adding confidence threshold for demo visualization in detectron2
What is optimistic lock and what is pessimistic lock
Phpcms V9 background article list adds one click push to Baidu function
行为树的基本概念及进阶
HDU - 6225 Little Boxes(__int128的使用)
小程序首页加载之前加载其他相关资源或配置(小程序的promise应用)
Self taught neural network series - 4 learning of neural network
行为树 文件说明
Yolov5 advanced 5 GPU environment setup
拦截器与过滤器的实现代码
Principe et application du micro - ordinateur à puce unique - Aperçu
Course paper: Copula modeling code of portfolio risk VaR
Data warehouse (1) what is data warehouse and what are the characteristics of data warehouse
Pytorch neural network