From 81f49be6b463d4bedb60ad81ae4127678c758763 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Wed, 6 Mar 2024 21:50:35 +0100 Subject: [PATCH] Doc: Update class docs --- doc/source/classes/class_blackboard.rst | 14 ------ doc/source/classes/class_blackboardplan.rst | 52 +++++++++++++++++---- doc/source/classes/class_btplayer.rst | 45 ++++++------------ doc_classes/BTPlayer.xml | 3 -- doc_classes/Blackboard.xml | 7 --- doc_classes/BlackboardPlan.xml | 11 ++++- 6 files changed, 65 insertions(+), 67 deletions(-) diff --git a/doc/source/classes/class_blackboard.rst b/doc/source/classes/class_blackboard.rst index 330d15b..ebd9a35 100644 --- a/doc/source/classes/class_blackboard.rst +++ b/doc/source/classes/class_blackboard.rst @@ -44,8 +44,6 @@ Methods +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ | bool | :ref:`has_var` **(** StringName var_name **)** |const| | +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`prefetch_nodepath_vars` **(** Node node **)** | - +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_parent` **(** :ref:`Blackboard` blackboard **)** | +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`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` on the agent instance. - -.. rst-class:: classref-item-separator - ----- - .. _class_Blackboard_method_set_parent: .. rst-class:: classref-method diff --git a/doc/source/classes/class_blackboardplan.rst b/doc/source/classes/class_blackboardplan.rst index 016269e..7bddb32 100644 --- a/doc/source/classes/class_blackboardplan.rst +++ b/doc/source/classes/class_blackboardplan.rst @@ -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` | ``true`` | + +------+-------------------------------------------------------------------------------------+----------+ + +.. rst-class:: classref-reftable-group + Methods ------- .. table:: :widths: auto - +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Blackboard` | :ref:`create_blackboard` **(** **)** | - +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`populate_blackboard` **(** :ref:`Blackboard` blackboard, bool overwrite **)** | - +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ + +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Blackboard` | :ref:`create_blackboard` **(** Node node **)** | + +-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`populate_blackboard` **(** :ref:`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` is created. .. rst-class:: classref-section-separator @@ -41,9 +75,9 @@ Method Descriptions .. rst-class:: classref-method -:ref:`Blackboard` **create_blackboard** **(** **)** +:ref:`Blackboard` **create_blackboard** **(** Node node **)** -Constructs a new instance of a :ref:`Blackboard` using this plan. +Constructs a new instance of a :ref:`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` using this pl .. rst-class:: classref-method -void **populate_blackboard** **(** :ref:`Blackboard` blackboard, bool overwrite **)** +void **populate_blackboard** **(** :ref:`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.)` diff --git a/doc/source/classes/class_btplayer.rst b/doc/source/classes/class_btplayer.rst index e5a3e0b..8678139 100644 --- a/doc/source/classes/class_btplayer.rst +++ b/doc/source/classes/class_btplayer.rst @@ -31,21 +31,19 @@ Properties .. table:: :widths: auto - +---------------------------------------------+-------------------------------------------------------------------------------+-----------+ - | bool | :ref:`active` | ``true`` | - +---------------------------------------------+-------------------------------------------------------------------------------+-----------+ - | :ref:`BehaviorTree` | :ref:`behavior_tree` | | - +---------------------------------------------+-------------------------------------------------------------------------------+-----------+ - | :ref:`Blackboard` | :ref:`blackboard` | | - +---------------------------------------------+-------------------------------------------------------------------------------+-----------+ - | :ref:`BlackboardPlan` | :ref:`blackboard_plan` | | - +---------------------------------------------+-------------------------------------------------------------------------------+-----------+ - | bool | :ref:`monitor_performance` | ``false`` | - +---------------------------------------------+-------------------------------------------------------------------------------+-----------+ - | bool | :ref:`prefetch_nodepath_vars` | ``true`` | - +---------------------------------------------+-------------------------------------------------------------------------------+-----------+ - | :ref:`UpdateMode` | :ref:`update_mode` | ``1`` | - +---------------------------------------------+-------------------------------------------------------------------------------+-----------+ + +---------------------------------------------+-------------------------------------------------------------------------+-----------+ + | bool | :ref:`active` | ``true`` | + +---------------------------------------------+-------------------------------------------------------------------------+-----------+ + | :ref:`BehaviorTree` | :ref:`behavior_tree` | | + +---------------------------------------------+-------------------------------------------------------------------------+-----------+ + | :ref:`Blackboard` | :ref:`blackboard` | | + +---------------------------------------------+-------------------------------------------------------------------------+-----------+ + | :ref:`BlackboardPlan` | :ref:`blackboard_plan` | | + +---------------------------------------------+-------------------------------------------------------------------------+-----------+ + | bool | :ref:`monitor_performance` | ``false`` | + +---------------------------------------------+-------------------------------------------------------------------------+-----------+ + | :ref:`UpdateMode` | :ref:`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` are replaced with ``Node`` references when the tree is instantiated. References are retrieved by calling :ref:`Node.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 diff --git a/doc_classes/BTPlayer.xml b/doc_classes/BTPlayer.xml index 1b9e9a6..ee232ca 100644 --- a/doc_classes/BTPlayer.xml +++ b/doc_classes/BTPlayer.xml @@ -52,9 +52,6 @@ If [code]true[/code], adds a performance monitor to "Debugger->Monitors" for each instance of this [BTPlayer] node. - - 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). - Determines when the behavior tree is executed. See [enum UpdateMode]. diff --git a/doc_classes/Blackboard.xml b/doc_classes/Blackboard.xml index ae2fa1f..41ee2a9 100644 --- a/doc_classes/Blackboard.xml +++ b/doc_classes/Blackboard.xml @@ -49,13 +49,6 @@ Returns [code]true[/code] if the Blackboard contains the [param var_name] variable, including the parent scopes. - - - - - 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. - - diff --git a/doc_classes/BlackboardPlan.xml b/doc_classes/BlackboardPlan.xml index c7c0218..fa40124 100644 --- a/doc_classes/BlackboardPlan.xml +++ b/doc_classes/BlackboardPlan.xml @@ -10,17 +10,24 @@ + - 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. + - 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. + + + Enables or disables [NodePath] variable prefetching. If [code]true[/code], [NodePath] values will be replaced with node instances when the [Blackboard] is created. + +