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| | | 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_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 **)** | | 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: .. _class_Blackboard_method_set_parent:
.. rst-class:: classref-method .. 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 .. 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 Methods
------- -------
.. table:: .. table::
:widths: auto :widths: auto
+-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Blackboard<class_Blackboard>` | :ref:`create_blackboard<class_BlackboardPlan_method_create_blackboard>` **(** **)** | | :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 **)** | | 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 .. rst-class:: classref-section-separator
@ -41,9 +75,9 @@ Method Descriptions
.. rst-class:: classref-method .. 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 .. 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 .. 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.)` .. |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.)` .. |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:: .. table::
:widths: auto :widths: auto
+---------------------------------------------+-------------------------------------------------------------------------------+-----------+ +---------------------------------------------+-------------------------------------------------------------------------+-----------+
| bool | :ref:`active<class_BTPlayer_property_active>` | ``true`` | | bool | :ref:`active<class_BTPlayer_property_active>` | ``true`` |
+---------------------------------------------+-------------------------------------------------------------------------------+-----------+ +---------------------------------------------+-------------------------------------------------------------------------+-----------+
| :ref:`BehaviorTree<class_BehaviorTree>` | :ref:`behavior_tree<class_BTPlayer_property_behavior_tree>` | | | :ref:`BehaviorTree<class_BehaviorTree>` | :ref:`behavior_tree<class_BTPlayer_property_behavior_tree>` | |
+---------------------------------------------+-------------------------------------------------------------------------------+-----------+ +---------------------------------------------+-------------------------------------------------------------------------+-----------+
| :ref:`Blackboard<class_Blackboard>` | :ref:`blackboard<class_BTPlayer_property_blackboard>` | | | :ref:`Blackboard<class_Blackboard>` | :ref:`blackboard<class_BTPlayer_property_blackboard>` | |
+---------------------------------------------+-------------------------------------------------------------------------------+-----------+ +---------------------------------------------+-------------------------------------------------------------------------+-----------+
| :ref:`BlackboardPlan<class_BlackboardPlan>` | :ref:`blackboard_plan<class_BTPlayer_property_blackboard_plan>` | | | :ref:`BlackboardPlan<class_BlackboardPlan>` | :ref:`blackboard_plan<class_BTPlayer_property_blackboard_plan>` | |
+---------------------------------------------+-------------------------------------------------------------------------------+-----------+ +---------------------------------------------+-------------------------------------------------------------------------+-----------+
| bool | :ref:`monitor_performance<class_BTPlayer_property_monitor_performance>` | ``false`` | | 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`` |
+---------------------------------------------+-------------------------------------------------------------------------------+-----------+ +---------------------------------------------+-------------------------------------------------------------------------+-----------+
| :ref:`UpdateMode<enum_BTPlayer_UpdateMode>` | :ref:`update_mode<class_BTPlayer_property_update_mode>` | ``1`` |
+---------------------------------------------+-------------------------------------------------------------------------------+-----------+
.. rst-class:: classref-reftable-group .. 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: .. _class_BTPlayer_property_update_mode:
.. rst-class:: classref-property .. 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"> <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. If [code]true[/code], adds a performance monitor to "Debugger-&gt;Monitors" for each instance of this [BTPlayer] node.
</member> </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"> <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]. Determines when the behavior tree is executed. See [enum UpdateMode].
</member> </member>

View File

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

View File

@ -10,17 +10,24 @@
<methods> <methods>
<method name="create_blackboard"> <method name="create_blackboard">
<return type="Blackboard" /> <return type="Blackboard" />
<param index="0" name="node" type="Node" />
<description> <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> </description>
</method> </method>
<method name="populate_blackboard"> <method name="populate_blackboard">
<return type="void" /> <return type="void" />
<param index="0" name="blackboard" type="Blackboard" /> <param index="0" name="blackboard" type="Blackboard" />
<param index="1" name="overwrite" type="bool" /> <param index="1" name="overwrite" type="bool" />
<param index="2" name="node" type="Node" />
<description> <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> </description>
</method> </method>
</methods> </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> </class>