2022-11-01 20:31:22 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2023-04-10 14:57:36 +00:00
<class name= "Blackboard" inherits= "RefCounted" version= "4.1" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../../../doc/class.xsd" >
2022-11-01 20:31:22 +00:00
<brief_description >
2022-11-04 12:27:09 +00:00
A key/value store to hold data shared by BT tasks.
2022-11-01 20:31:22 +00:00
</brief_description>
<description >
2022-11-04 12:27:09 +00:00
A key/value store to hold data shared by tasks of a behavior tree.
Blackboard can serve as a parent scope for another blackboard. In this way, if a value is not found in the active scope, a parent scope Blackboard is asked to return a value. A parent scope Blackboard can have its own parent scope. This structure is called Blackboard scope chain. There is no limit on how many Blackboards can take part in a chain. Blackboard never overwrites parent scope values.
A new scope can be created by [BTNewScope] or [BTSubtree] tasks. It is automatically created for any [LimboState] that has a non-empty Blackboard data defined, or for any root [LimboHSM].
2022-11-01 20:31:22 +00:00
</description>
<tutorials >
</tutorials>
<methods >
2023-04-10 14:57:36 +00:00
<method name= "erase_var" >
<return type= "void" />
<param index= "0" name= "p_key" type= "Variant" />
<description >
Removes variable by name.
</description>
</method>
2022-11-01 20:31:22 +00:00
<method name= "get_data" qualifiers= "const" >
<return type= "Dictionary" />
<description >
2022-11-04 12:27:09 +00:00
Returns [Blackboard] data as a [Dictionary].
2022-11-01 20:31:22 +00:00
</description>
</method>
<method name= "get_parent_scope" qualifiers= "const" >
<return type= "Blackboard" />
<description >
2022-11-04 12:27:09 +00:00
Returns a [Blackboard] that serves as a parent scope for this instance.
2022-11-01 20:31:22 +00:00
</description>
</method>
<method name= "get_var" qualifiers= "const" >
<return type= "Variant" />
2023-04-10 14:57:36 +00:00
<param index= "0" name= "p_key" type= "Variant" />
<param index= "1" name= "p_default" type= "Variant" default= "null" />
2022-11-01 20:31:22 +00:00
<description >
2022-11-04 12:27:09 +00:00
Returns variable value.
2022-11-01 20:31:22 +00:00
</description>
</method>
<method name= "has_var" qualifiers= "const" >
<return type= "bool" />
2023-04-10 14:57:36 +00:00
<param index= "0" name= "p_key" type= "Variant" />
2022-11-01 20:31:22 +00:00
<description >
2022-11-04 12:27:09 +00:00
Returns [code]true[/code] if Blackboard contains [code]p_key[/code] variable. Parent scope included.
2022-11-01 20:31:22 +00:00
</description>
</method>
<method name= "prefetch_nodepath_vars" >
<return type= "void" />
2023-04-10 14:57:36 +00:00
<param index= "0" name= "p_node" type= "Node" />
2022-11-01 20:31:22 +00:00
<description >
2022-11-04 12:27:09 +00:00
Replaces NodePath variables in the [Blackboard] with references that are retrieved by calling [method Node.get_node] on a [code]p_node[/code] argument.
2022-11-01 20:31:22 +00:00
</description>
</method>
<method name= "set_data" >
<return type= "void" />
2023-04-10 14:57:36 +00:00
<param index= "0" name= "p_data" type= "Dictionary" />
2022-11-01 20:31:22 +00:00
<description >
2022-11-04 12:27:09 +00:00
Overrides Blackboard data, discarding anything that was stored at this scope. Use with caution.
2022-11-01 20:31:22 +00:00
</description>
</method>
<method name= "set_parent_scope" >
<return type= "void" />
2023-04-10 14:57:36 +00:00
<param index= "0" name= "p_blackboard" type= "Blackboard" />
2022-11-01 20:31:22 +00:00
<description >
2022-11-04 12:27:09 +00:00
Sets the parent scope. If a value is not found in the Blackboard's active scope, the parent scope Blackboard will be asked to retrieve it.
2022-11-01 20:31:22 +00:00
</description>
</method>
<method name= "set_var" >
<return type= "void" />
2023-04-10 14:57:36 +00:00
<param index= "0" name= "p_key" type= "Variant" />
<param index= "1" name= "p_value" type= "Variant" />
2022-11-01 20:31:22 +00:00
<description >
2022-11-04 12:27:09 +00:00
Sets value of blackboard variable.
2022-11-01 20:31:22 +00:00
</description>
</method>
2023-04-10 14:57:36 +00:00
<method name= "top" qualifiers= "const" >
<return type= "Blackboard" />
<description >
Returns topmost [Blackboard] in the scope chain.
</description>
</method>
2022-11-01 20:31:22 +00:00
</methods>
</class>