limboai/doc_classes/Blackboard.xml

88 lines
4.0 KiB
XML
Raw Permalink Normal View History

2022-11-01 20:31:22 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Blackboard" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
2022-11-01 20:31:22 +00:00
<brief_description>
2023-10-27 12:21:23 +00:00
A key/value storage for sharing among [LimboHSM] states and [BehaviorTree] tasks.
2022-11-01 20:31:22 +00:00
</brief_description>
<description>
2023-10-27 12:21:23 +00:00
Blackboard is where data is stored and shared between states in the [LimboHSM] system and tasks in a [BehaviorTree]. Each state and task in the [BehaviorTree] can access this Blackboard, allowing them to read and write data. This makes it easy to share information between different actions and behaviors.
Blackboard can also act as a parent scope for another Blackboard. If a specific variable is not found in the active scope, it looks in the parent Blackboard to find it. A parent Blackboard can itself have its own parent scope, forming what we call a "blackboard scope chain." Importantly, there is no limit to how many Blackboards can be in this chain, and the Blackboard doesn't modify values in the parent scopes.
New scopes can be created using the [BTNewScope] and [BTSubtree] decorators. Additionally, a new scope is automatically created for any [LimboState] that has defined non-empty Blackboard data or for any root-level [LimboHSM] node.
2022-11-01 20:31:22 +00:00
</description>
<tutorials>
</tutorials>
<methods>
<method name="bind_var_to_property">
<return type="void" />
<param index="0" name="p_name" type="String" />
<param index="1" name="p_object" type="Object" />
<param index="2" name="p_property" type="StringName" />
<description>
Establish a binding between a variable and the object's property specified by [param p_property] and [param p_object]. Changes to the variable update the property, and vice versa.
</description>
</method>
2023-04-10 14:57:36 +00:00
<method name="erase_var">
<return type="void" />
2024-01-25 13:56:59 +00:00
<param index="0" name="p_name" type="String" />
2023-04-10 14:57:36 +00:00
<description>
2023-10-27 12:21:23 +00:00
Removes a variable by its name.
2023-04-10 14:57:36 +00:00
</description>
</method>
2022-11-01 20:31:22 +00:00
<method name="get_parent_scope" qualifiers="const">
<return type="Blackboard" />
<description>
2023-10-27 12:21:23 +00:00
Returns a Blackboard that serves as the parent scope for this instance.
2022-11-01 20:31:22 +00:00
</description>
</method>
<method name="get_var" qualifiers="const">
<return type="Variant" />
2024-01-25 13:56:59 +00:00
<param index="0" name="p_name" type="String" />
2023-04-10 14:57:36 +00:00
<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" />
2024-01-25 13:56:59 +00:00
<param index="0" name="p_name" type="String" />
2022-11-01 20:31:22 +00:00
<description>
Returns [code]true[/code] if the Blackboard contains the [param p_key] variable, including the parent scopes.
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>
2023-10-27 12:21:23 +00:00
If [code]true[/code], any [NodePath] variables in the [Blackboard] are replaced with [Node] references when the tree is instantiated. References are retrieved by calling [method Node.get_node] on the agent instance.
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>
2023-10-27 12:21:23 +00:00
Assigns the parent scope. If a value isn't in the current Blackboard scope, it will look in the parent scope Blackboard to find it.
2022-11-01 20:31:22 +00:00
</description>
</method>
<method name="set_var">
<return type="void" />
2024-01-25 13:56:59 +00:00
<param index="0" name="p_name" type="String" />
2023-04-10 14:57:36 +00:00
<param index="1" name="p_value" type="Variant" />
2022-11-01 20:31:22 +00:00
<description>
2023-10-27 12:21:23 +00:00
Assigns a value to a 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>
2023-10-27 12:21:23 +00:00
Returns the topmost [Blackboard] in the scope chain.
2023-04-10 14:57:36 +00:00
</description>
</method>
<method name="unbind_var">
<return type="void" />
<param index="0" name="p_name" type="String" />
<description>
Remove binding from a variable.
</description>
</method>
2022-11-01 20:31:22 +00:00
</methods>
</class>