94 lines
4.9 KiB
XML
94 lines
4.9 KiB
XML
<?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">
|
|
<brief_description>
|
|
A key/value storage for sharing among [LimboHSM] states and [BehaviorTree] tasks.
|
|
</brief_description>
|
|
<description>
|
|
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.
|
|
</description>
|
|
<tutorials>
|
|
</tutorials>
|
|
<methods>
|
|
<method name="bind_var_to_property">
|
|
<return type="void" />
|
|
<param index="0" name="var_name" type="StringName" />
|
|
<param index="1" name="object" type="Object" />
|
|
<param index="2" name="property" type="StringName" />
|
|
<param index="3" name="create" type="bool" />
|
|
<description>
|
|
Establish a binding between a variable and the object's property specified by [param property] and [param object]. Changes to the variable update the property, and vice versa. If [param create] is [code]true[/code], the variable will be created if it doesn't exist.
|
|
</description>
|
|
</method>
|
|
<method name="erase_var">
|
|
<return type="void" />
|
|
<param index="0" name="var_name" type="StringName" />
|
|
<description>
|
|
Removes a variable by its name.
|
|
</description>
|
|
</method>
|
|
<method name="get_parent" qualifiers="const">
|
|
<return type="Blackboard" />
|
|
<description>
|
|
Returns a Blackboard that serves as the parent scope for this instance.
|
|
</description>
|
|
</method>
|
|
<method name="get_var" qualifiers="const">
|
|
<return type="Variant" />
|
|
<param index="0" name="var_name" type="StringName" />
|
|
<param index="1" name="default" type="Variant" default="null" />
|
|
<param index="2" name="complain" type="bool" default="true" />
|
|
<description>
|
|
Returns variable value or [param default] if variable doesn't exist. If [param complain] is [code]true[/code], an error will be printed if variable doesn't exist.
|
|
</description>
|
|
</method>
|
|
<method name="has_var" qualifiers="const">
|
|
<return type="bool" />
|
|
<param index="0" name="var_name" type="StringName" />
|
|
<description>
|
|
Returns [code]true[/code] if the Blackboard contains the [param var_name] variable, including the parent scopes.
|
|
</description>
|
|
</method>
|
|
<method name="link_var">
|
|
<return type="void" />
|
|
<param index="0" name="var_name" type="StringName" />
|
|
<param index="1" name="target_blackboard" type="Blackboard" />
|
|
<param index="2" name="target_var" type="StringName" />
|
|
<param index="3" name="create" type="bool" />
|
|
<description>
|
|
Links a variable to another Blackboard variable. If a variable is linked to another variable, their state will always be identical, and any change to one will be reflected in the other. If [param create] is [code]true[/code], the variable will be created if it doesn't exist.
|
|
You can use this method to link a variable in the current scope to a variable in another scope, or in another Blackboard instance. A variable can only be linked to one other variable. Calling this method again will overwrite the previous link. However, it is possible to link to the same variable from multiple different variables.
|
|
</description>
|
|
</method>
|
|
<method name="set_parent">
|
|
<return type="void" />
|
|
<param index="0" name="blackboard" type="Blackboard" />
|
|
<description>
|
|
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.
|
|
</description>
|
|
</method>
|
|
<method name="set_var">
|
|
<return type="void" />
|
|
<param index="0" name="var_name" type="StringName" />
|
|
<param index="1" name="value" type="Variant" />
|
|
<description>
|
|
Assigns a value to a Blackboard variable.
|
|
</description>
|
|
</method>
|
|
<method name="top" qualifiers="const">
|
|
<return type="Blackboard" />
|
|
<description>
|
|
Returns the topmost [Blackboard] in the scope chain.
|
|
</description>
|
|
</method>
|
|
<method name="unbind_var">
|
|
<return type="void" />
|
|
<param index="0" name="var_name" type="StringName" />
|
|
<description>
|
|
Remove binding from a variable.
|
|
</description>
|
|
</method>
|
|
</methods>
|
|
</class>
|