Doc: Update class docs

This commit is contained in:
Serhii Snitsaruk 2024-03-06 21:50:35 +01:00
parent 2658060b1c
commit 81f49be6b4
6 changed files with 65 additions and 67 deletions

View File

@ -44,8 +44,6 @@ Methods
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| bool | :ref:`has_var<class_Blackboard_method_has_var>` **(** StringName var_name **)** |const| |
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`prefetch_nodepath_vars<class_Blackboard_method_prefetch_nodepath_vars>` **(** Node node **)** |
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_parent<class_Blackboard_method_set_parent>` **(** :ref:`Blackboard<class_Blackboard>` blackboard **)** |
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_var<class_Blackboard_method_set_var>` **(** StringName var_name, Variant value **)** |
@ -124,18 +122,6 @@ Returns ``true`` if the Blackboard contains the ``var_name`` variable, including
----
.. _class_Blackboard_method_prefetch_nodepath_vars:
.. rst-class:: classref-method
void **prefetch_nodepath_vars** **(** Node node **)**
If ``true``, any ``NodePath`` variables in the **Blackboard** are replaced with ``Node`` references when the tree is instantiated. References are retrieved by calling :ref:`Node.get_node<class_Node_method_get_node>` on the agent instance.
.. rst-class:: classref-item-separator
----
.. _class_Blackboard_method_set_parent:
.. rst-class:: classref-method

View File

@ -16,17 +16,51 @@ Stores and manages variables that will be used in constructing new :ref:`Blackbo
.. rst-class:: classref-reftable-group
Properties
----------
.. table::
:widths: auto
+------+-------------------------------------------------------------------------------------+----------+
| bool | :ref:`prefetch_nodepath_vars<class_BlackboardPlan_property_prefetch_nodepath_vars>` | ``true`` |
+------+-------------------------------------------------------------------------------------+----------+
.. rst-class:: classref-reftable-group
Methods
-------
.. table::
:widths: auto
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Blackboard<class_Blackboard>` | :ref:`create_blackboard<class_BlackboardPlan_method_create_blackboard>` **(** **)** |
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`populate_blackboard<class_BlackboardPlan_method_populate_blackboard>` **(** :ref:`Blackboard<class_Blackboard>` blackboard, bool overwrite **)** |
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Blackboard<class_Blackboard>` | :ref:`create_blackboard<class_BlackboardPlan_method_create_blackboard>` **(** Node node **)** |
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`populate_blackboard<class_BlackboardPlan_method_populate_blackboard>` **(** :ref:`Blackboard<class_Blackboard>` blackboard, bool overwrite, Node node **)** |
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_BlackboardPlan_property_prefetch_nodepath_vars:
.. rst-class:: classref-property
bool **prefetch_nodepath_vars** = ``true``
.. rst-class:: classref-property-setget
- void **set_prefetch_nodepath_vars** **(** bool value **)**
- bool **is_prefetching_nodepath_vars** **(** **)**
Enables or disables ``NodePath`` variable prefetching. If ``true``, ``NodePath`` values will be replaced with node instances when the :ref:`Blackboard<class_Blackboard>` is created.
.. rst-class:: classref-section-separator
@ -41,9 +75,9 @@ Method Descriptions
.. rst-class:: classref-method
:ref:`Blackboard<class_Blackboard>` **create_blackboard** **(** **)**
:ref:`Blackboard<class_Blackboard>` **create_blackboard** **(** Node node **)**
Constructs a new instance of a :ref:`Blackboard<class_Blackboard>` using this plan.
Constructs a new instance of a :ref:`Blackboard<class_Blackboard>` using this plan. If ``NodePath`` prefetching is enabled, ``node`` will be used to retrieve node instances for ``NodePath`` variables and substitute their values.
.. rst-class:: classref-item-separator
@ -53,9 +87,9 @@ Constructs a new instance of a :ref:`Blackboard<class_Blackboard>` using this pl
.. rst-class:: classref-method
void **populate_blackboard** **(** :ref:`Blackboard<class_Blackboard>` blackboard, bool overwrite **)**
void **populate_blackboard** **(** :ref:`Blackboard<class_Blackboard>` blackboard, bool overwrite, Node node **)**
Populates ``blackboard`` with the variables from this plan. If ``overwrite`` is ``true``, existing variables with the same names will be overwritten.
Populates ``blackboard`` with the variables from this plan. If ``overwrite`` is ``true``, existing variables with the same names will be overwritten. If ``NodePath`` prefetching is enabled, ``node`` will be used to retrieve node instances for ``NodePath`` variables and substitute their values.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`

View File

@ -31,21 +31,19 @@ Properties
.. table::
:widths: auto
+---------------------------------------------+-------------------------------------------------------------------------------+-----------+
| bool | :ref:`active<class_BTPlayer_property_active>` | ``true`` |
+---------------------------------------------+-------------------------------------------------------------------------------+-----------+
| :ref:`BehaviorTree<class_BehaviorTree>` | :ref:`behavior_tree<class_BTPlayer_property_behavior_tree>` | |
+---------------------------------------------+-------------------------------------------------------------------------------+-----------+
| :ref:`Blackboard<class_Blackboard>` | :ref:`blackboard<class_BTPlayer_property_blackboard>` | |
+---------------------------------------------+-------------------------------------------------------------------------------+-----------+
| :ref:`BlackboardPlan<class_BlackboardPlan>` | :ref:`blackboard_plan<class_BTPlayer_property_blackboard_plan>` | |
+---------------------------------------------+-------------------------------------------------------------------------------+-----------+
| bool | :ref:`monitor_performance<class_BTPlayer_property_monitor_performance>` | ``false`` |
+---------------------------------------------+-------------------------------------------------------------------------------+-----------+
| bool | :ref:`prefetch_nodepath_vars<class_BTPlayer_property_prefetch_nodepath_vars>` | ``true`` |
+---------------------------------------------+-------------------------------------------------------------------------------+-----------+
| :ref:`UpdateMode<enum_BTPlayer_UpdateMode>` | :ref:`update_mode<class_BTPlayer_property_update_mode>` | ``1`` |
+---------------------------------------------+-------------------------------------------------------------------------------+-----------+
+---------------------------------------------+-------------------------------------------------------------------------+-----------+
| bool | :ref:`active<class_BTPlayer_property_active>` | ``true`` |
+---------------------------------------------+-------------------------------------------------------------------------+-----------+
| :ref:`BehaviorTree<class_BehaviorTree>` | :ref:`behavior_tree<class_BTPlayer_property_behavior_tree>` | |
+---------------------------------------------+-------------------------------------------------------------------------+-----------+
| :ref:`Blackboard<class_Blackboard>` | :ref:`blackboard<class_BTPlayer_property_blackboard>` | |
+---------------------------------------------+-------------------------------------------------------------------------+-----------+
| :ref:`BlackboardPlan<class_BlackboardPlan>` | :ref:`blackboard_plan<class_BTPlayer_property_blackboard_plan>` | |
+---------------------------------------------+-------------------------------------------------------------------------+-----------+
| bool | :ref:`monitor_performance<class_BTPlayer_property_monitor_performance>` | ``false`` |
+---------------------------------------------+-------------------------------------------------------------------------+-----------+
| :ref:`UpdateMode<enum_BTPlayer_UpdateMode>` | :ref:`update_mode<class_BTPlayer_property_update_mode>` | ``1`` |
+---------------------------------------------+-------------------------------------------------------------------------+-----------+
.. rst-class:: classref-reftable-group
@ -226,23 +224,6 @@ If ``true``, adds a performance monitor to "Debugger->Monitors" for each instanc
----
.. _class_BTPlayer_property_prefetch_nodepath_vars:
.. rst-class:: classref-property
bool **prefetch_nodepath_vars** = ``true``
.. rst-class:: classref-property-setget
- void **set_prefetch_nodepath_vars** **(** bool value **)**
- bool **get_prefetch_nodepath_vars** **(** **)**
If ``true``, any ``NodePath`` variables in the :ref:`Blackboard<class_Blackboard>` are replaced with ``Node`` references when the tree is instantiated. References are retrieved by calling :ref:`Node.get_node<class_Node_method_get_node>` on the agent instance (agent is the owner of the BTPlayer node).
.. rst-class:: classref-item-separator
----
.. _class_BTPlayer_property_update_mode:
.. rst-class:: classref-property

View File

@ -52,9 +52,6 @@
<member name="monitor_performance" type="bool" setter="_set_monitor_performance" getter="_get_monitor_performance" default="false">
If [code]true[/code], adds a performance monitor to "Debugger-&gt;Monitors" for each instance of this [BTPlayer] node.
</member>
<member name="prefetch_nodepath_vars" type="bool" setter="set_prefetch_nodepath_vars" getter="get_prefetch_nodepath_vars" default="true">
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 (agent is the owner of the BTPlayer node).
</member>
<member name="update_mode" type="int" setter="set_update_mode" getter="get_update_mode" enum="BTPlayer.UpdateMode" default="1">
Determines when the behavior tree is executed. See [enum UpdateMode].
</member>

View File

@ -49,13 +49,6 @@
Returns [code]true[/code] if the Blackboard contains the [param var_name] variable, including the parent scopes.
</description>
</method>
<method name="prefetch_nodepath_vars">
<return type="void" />
<param index="0" name="node" type="Node" />
<description>
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.
</description>
</method>
<method name="set_parent">
<return type="void" />
<param index="0" name="blackboard" type="Blackboard" />

View File

@ -10,17 +10,24 @@
<methods>
<method name="create_blackboard">
<return type="Blackboard" />
<param index="0" name="node" type="Node" />
<description>
Constructs a new instance of a [Blackboard] using this plan.
Constructs a new instance of a [Blackboard] using this plan. If [NodePath] prefetching is enabled, [param node] will be used to retrieve node instances for [NodePath] variables and substitute their values.
</description>
</method>
<method name="populate_blackboard">
<return type="void" />
<param index="0" name="blackboard" type="Blackboard" />
<param index="1" name="overwrite" type="bool" />
<param index="2" name="node" type="Node" />
<description>
Populates [param blackboard] with the variables from this plan. If [param overwrite] is [code]true[/code], existing variables with the same names will be overwritten.
Populates [param blackboard] with the variables from this plan. If [param overwrite] is [code]true[/code], existing variables with the same names will be overwritten. If [NodePath] prefetching is enabled, [param node] will be used to retrieve node instances for [NodePath] variables and substitute their values.
</description>
</method>
</methods>
<members>
<member name="prefetch_nodepath_vars" type="bool" setter="set_prefetch_nodepath_vars" getter="is_prefetching_nodepath_vars" default="true">
Enables or disables [NodePath] variable prefetching. If [code]true[/code], [NodePath] values will be replaced with node instances when the [Blackboard] is created.
</member>
</members>
</class>