From 9abfe4ce95391351d812491b6124a6008a6ff66d Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Sat, 3 Aug 2024 13:14:31 +0200 Subject: [PATCH] Update class docs --- config.py | 1 + doc/source/classes/class_behaviortree.rst | 6 +- doc/source/classes/class_behaviortreedata.rst | 14 +- doc/source/classes/class_btinstance.rst | 206 ++++++++++++++++++ doc/source/classes/class_btplayer.rst | 34 +-- doc/source/classes/class_btstate.rst | 12 +- doc_classes/BTInstance.xml | 74 +++++++ doc_classes/BTPlayer.xml | 12 +- doc_classes/BTState.xml | 6 +- doc_classes/BehaviorTree.xml | 4 +- doc_classes/BehaviorTreeData.xml | 8 +- 11 files changed, 319 insertions(+), 58 deletions(-) create mode 100644 doc/source/classes/class_btinstance.rst create mode 100644 doc_classes/BTInstance.xml diff --git a/config.py b/config.py index fe81b90f..8bbe518 100644 --- a/config.py +++ b/config.py @@ -83,6 +83,7 @@ def get_doc_classes(): "BTDynamicSequence", "BTFail", "BTForEach", + "BTInstance", "BTInvert", "BTNewScope", "BTParallel", diff --git a/doc/source/classes/class_behaviortree.rst b/doc/source/classes/class_behaviortree.rst index 4148cf5..daea317 100644 --- a/doc/source/classes/class_behaviortree.rst +++ b/doc/source/classes/class_behaviortree.rst @@ -62,7 +62,7 @@ Methods +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`BTTask` | :ref:`get_root_task`\ (\ ) |const| | +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`BTTask` | :ref:`instantiate`\ (\ agent\: ``Node``, blackboard\: :ref:`Blackboard`, scene_root\: ``Node``\ ) |const| | + | :ref:`BTInstance` | :ref:`instantiate`\ (\ agent\: ``Node``, blackboard\: :ref:`Blackboard`, scene_root\: ``Node``\ ) |const| | +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_root_task`\ (\ task\: :ref:`BTTask`\ ) | +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -172,9 +172,9 @@ Returns the root task of the BehaviorTree resource. .. rst-class:: classref-method -:ref:`BTTask` **instantiate**\ (\ agent\: ``Node``, blackboard\: :ref:`Blackboard`, scene_root\: ``Node``\ ) |const| :ref:`🔗` +:ref:`BTInstance` **instantiate**\ (\ agent\: ``Node``, blackboard\: :ref:`Blackboard`, scene_root\: ``Node``\ ) |const| :ref:`🔗` -Instantiates the behavior tree and returns the root :ref:`BTTask`. ``scene_root`` should be the root node of the scene that the Behavior Tree will be used in (e.g., the owner of the node that contains the behavior tree). +Instantiates the behavior tree and returns :ref:`BTInstance`. ``scene_root`` should be the root node of the scene that the Behavior Tree will be used in (e.g., the owner of the node that contains the behavior tree instance). .. rst-class:: classref-item-separator diff --git a/doc/source/classes/class_behaviortreedata.rst b/doc/source/classes/class_behaviortreedata.rst index 607312e..1f157bf 100644 --- a/doc/source/classes/class_behaviortreedata.rst +++ b/doc/source/classes/class_behaviortreedata.rst @@ -31,9 +31,9 @@ Methods .. table:: :widths: auto - +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`BehaviorTreeData` | :ref:`create_from_tree_instance`\ (\ tree_instance\: :ref:`BTTask`\ ) |static| | - +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ + +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`BehaviorTreeData` | :ref:`create_from_bt_instance`\ (\ bt_instance\: :ref:`BTInstance`\ ) |static| | + +-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -44,15 +44,15 @@ Methods Method Descriptions ------------------- -.. _class_BehaviorTreeData_method_create_from_tree_instance: +.. _class_BehaviorTreeData_method_create_from_bt_instance: .. rst-class:: classref-method -:ref:`BehaviorTreeData` **create_from_tree_instance**\ (\ tree_instance\: :ref:`BTTask`\ ) |static| :ref:`🔗` +:ref:`BehaviorTreeData` **create_from_bt_instance**\ (\ bt_instance\: :ref:`BTInstance`\ ) |static| :ref:`🔗` -Returns current state of the ``tree_instance`` encoded as a **BehaviorTreeData**, suitable for use with :ref:`BehaviorTreeView`. +Returns current state of the ``bt_instance`` encoded as a **BehaviorTreeData**, suitable for use with :ref:`BehaviorTreeView`. -Behavior tree instance can be acquired with :ref:`BTPlayer.get_tree_instance`. +Behavior tree instance can be acquired with :ref:`BTPlayer.get_bt_instance`. .. |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_btinstance.rst b/doc/source/classes/class_btinstance.rst new file mode 100644 index 0000000..7b2e993 --- /dev/null +++ b/doc/source/classes/class_btinstance.rst @@ -0,0 +1,206 @@ +:github_url: hide + +.. DO NOT EDIT THIS FILE!!! +.. Generated automatically from Godot engine sources. +.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. +.. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTInstance.xml. + +.. _class_BTInstance: + +BTInstance +========== + +**Inherits:** + +.. container:: contribute + + There is currently no description for this class. Please help us by :ref:`contributing one `! + +.. rst-class:: classref-reftable-group + +Properties +---------- + +.. table:: + :widths: auto + + +----------+---------------------------------------------------------------------------+-----------+ + | ``bool`` | :ref:`monitor_performance` | ``false`` | + +----------+---------------------------------------------------------------------------+-----------+ + +.. rst-class:: classref-reftable-group + +Methods +------- + +.. table:: + :widths: auto + + +-------------------------------+-----------------------------------------------------------------------------------------+ + | :ref:`Status` | :ref:`get_last_status`\ (\ ) |const| | + +-------------------------------+-----------------------------------------------------------------------------------------+ + | ``Node`` | :ref:`get_owner_node`\ (\ ) |const| | + +-------------------------------+-----------------------------------------------------------------------------------------+ + | :ref:`BTTask` | :ref:`get_root_task`\ (\ ) |const| | + +-------------------------------+-----------------------------------------------------------------------------------------+ + | ``String`` | :ref:`get_source_bt_path`\ (\ ) |const| | + +-------------------------------+-----------------------------------------------------------------------------------------+ + | |void| | :ref:`register_with_debugger`\ (\ ) | + +-------------------------------+-----------------------------------------------------------------------------------------+ + | |void| | :ref:`unregister_with_debugger`\ (\ ) | + +-------------------------------+-----------------------------------------------------------------------------------------+ + | :ref:`Status` | :ref:`update`\ (\ delta\: ``float``\ ) | + +-------------------------------+-----------------------------------------------------------------------------------------+ + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Signals +------- + +.. _class_BTInstance_signal_freed: + +.. rst-class:: classref-signal + +**freed**\ (\ ) :ref:`🔗` + +Emitted when the behavior tree instance is freed. Used by debugger to unregister. + +.. rst-class:: classref-item-separator + +---- + +.. _class_BTInstance_signal_updated: + +.. rst-class:: classref-signal + +**updated**\ (\ status\: ``int``\ ) :ref:`🔗` + +Emitted when the behavior tree instance has finished updating. + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Property Descriptions +--------------------- + +.. _class_BTInstance_property_monitor_performance: + +.. rst-class:: classref-property + +``bool`` **monitor_performance** = ``false`` :ref:`🔗` + +.. rst-class:: classref-property-setget + +- |void| **set_monitor_performance**\ (\ value\: ``bool``\ ) +- ``bool`` **get_monitor_performance**\ (\ ) + +If ``true``, adds a performance monitor for this instance to "Debugger->Monitors" in the editor. + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Method Descriptions +------------------- + +.. _class_BTInstance_method_get_last_status: + +.. rst-class:: classref-method + +:ref:`Status` **get_last_status**\ (\ ) |const| :ref:`🔗` + +Returns the execution status of the last update. + +.. rst-class:: classref-item-separator + +---- + +.. _class_BTInstance_method_get_owner_node: + +.. rst-class:: classref-method + +``Node`` **get_owner_node**\ (\ ) |const| :ref:`🔗` + +Returns the scene ``Node`` that owns this behavior tree instance. + +.. rst-class:: classref-item-separator + +---- + +.. _class_BTInstance_method_get_root_task: + +.. rst-class:: classref-method + +:ref:`BTTask` **get_root_task**\ (\ ) |const| :ref:`🔗` + +Returns the root task of the behavior tree instance. + +.. rst-class:: classref-item-separator + +---- + +.. _class_BTInstance_method_get_source_bt_path: + +.. rst-class:: classref-method + +``String`` **get_source_bt_path**\ (\ ) |const| :ref:`🔗` + +Returns the file path to the behavior tree resource that was used to create this instance. + +.. rst-class:: classref-item-separator + +---- + +.. _class_BTInstance_method_register_with_debugger: + +.. rst-class:: classref-method + +|void| **register_with_debugger**\ (\ ) :ref:`🔗` + +Registers the behavior tree instance with the debugger. + +.. rst-class:: classref-item-separator + +---- + +.. _class_BTInstance_method_unregister_with_debugger: + +.. rst-class:: classref-method + +|void| **unregister_with_debugger**\ (\ ) :ref:`🔗` + +Unregisters the behavior tree instance from the debugger. This is typically + +not necessary, as the debugger will automatically unregister the instance + +when it is freed. + +.. rst-class:: classref-item-separator + +---- + +.. _class_BTInstance_method_update: + +.. rst-class:: classref-method + +:ref:`Status` **update**\ (\ delta\: ``float``\ ) :ref:`🔗` + +Ticks the behavior tree instance and returns its status. + +.. |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.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` +.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` +.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` +.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` +.. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` +.. |void| replace:: :abbr:`void (No return value.)` diff --git a/doc/source/classes/class_btplayer.rst b/doc/source/classes/class_btplayer.rst index 802e3fa..d92a25a 100644 --- a/doc/source/classes/class_btplayer.rst +++ b/doc/source/classes/class_btplayer.rst @@ -55,15 +55,13 @@ Methods .. table:: :widths: auto - +-----------------------------+-----------------------------------------------------------------------------+ - | ``int`` | :ref:`get_last_status`\ (\ ) |const| | - +-----------------------------+-----------------------------------------------------------------------------+ - | :ref:`BTTask` | :ref:`get_tree_instance`\ (\ ) | - +-----------------------------+-----------------------------------------------------------------------------+ - | |void| | :ref:`restart`\ (\ ) | - +-----------------------------+-----------------------------------------------------------------------------+ - | |void| | :ref:`update`\ (\ delta\: ``float``\ ) | - +-----------------------------+-----------------------------------------------------------------------------+ + +-------------------------------------+----------------------------------------------------------------------+ + | :ref:`BTInstance` | :ref:`get_bt_instance`\ (\ ) | + +-------------------------------------+----------------------------------------------------------------------+ + | |void| | :ref:`restart`\ (\ ) | + +-------------------------------------+----------------------------------------------------------------------+ + | |void| | :ref:`update`\ (\ delta\: ``float``\ ) | + +-------------------------------------+----------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -265,25 +263,13 @@ Determines when the behavior tree is executed. See :ref:`UpdateMode` +:ref:`BTInstance` **get_bt_instance**\ (\ ) :ref:`🔗` -Returns the behavior tree's last execution status. See :ref:`Status`. - -.. rst-class:: classref-item-separator - ----- - -.. _class_BTPlayer_method_get_tree_instance: - -.. rst-class:: classref-method - -:ref:`BTTask` **get_tree_instance**\ (\ ) :ref:`🔗` - -Returns the root task of the instantiated behavior tree. +Returns the behavior tree instance. .. rst-class:: classref-item-separator diff --git a/doc/source/classes/class_btstate.rst b/doc/source/classes/class_btstate.rst index 01a7938..dd6c5fd 100644 --- a/doc/source/classes/class_btstate.rst +++ b/doc/source/classes/class_btstate.rst @@ -45,9 +45,9 @@ Methods .. table:: :widths: auto - +-----------------------------+--------------------------------------------------------------------------------+ - | :ref:`BTTask` | :ref:`get_tree_instance`\ (\ ) |const| | - +-----------------------------+--------------------------------------------------------------------------------+ + +-------------------------------------+----------------------------------------------------------------------------+ + | :ref:`BTInstance` | :ref:`get_bt_instance`\ (\ ) |const| | + +-------------------------------------+----------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -114,13 +114,13 @@ HSM event that will be dispatched when the behavior tree results in ``SUCCESS``. Method Descriptions ------------------- -.. _class_BTState_method_get_tree_instance: +.. _class_BTState_method_get_bt_instance: .. rst-class:: classref-method -:ref:`BTTask` **get_tree_instance**\ (\ ) |const| :ref:`🔗` +:ref:`BTInstance` **get_bt_instance**\ (\ ) |const| :ref:`🔗` -Returns the root task of the instantiated behavior tree. +Returns the behavior tree instance. .. |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_classes/BTInstance.xml b/doc_classes/BTInstance.xml new file mode 100644 index 0000000..4566c63 --- /dev/null +++ b/doc_classes/BTInstance.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + Returns the execution status of the last update. + + + + + + Returns the scene [Node] that owns this behavior tree instance. + + + + + + Returns the root task of the behavior tree instance. + + + + + + Returns the file path to the behavior tree resource that was used to create this instance. + + + + + + Registers the behavior tree instance with the debugger. + + + + + + Unregisters the behavior tree instance from the debugger. This is typically + not necessary, as the debugger will automatically unregister the instance + when it is freed. + + + + + + + Ticks the behavior tree instance and returns its status. + + + + + + If [code]true[/code], adds a performance monitor for this instance to "Debugger->Monitors" in the editor. + + + + + + Emitted when the behavior tree instance is freed. Used by debugger to unregister. + + + + + + Emitted when the behavior tree instance has finished updating. + + + + diff --git a/doc_classes/BTPlayer.xml b/doc_classes/BTPlayer.xml index 060a2f7..c8e8a39 100644 --- a/doc_classes/BTPlayer.xml +++ b/doc_classes/BTPlayer.xml @@ -10,16 +10,10 @@ - - + + - Returns the behavior tree's last execution status. See [enum BT.Status]. - - - - - - Returns the root task of the instantiated behavior tree. + Returns the behavior tree instance. diff --git a/doc_classes/BTState.xml b/doc_classes/BTState.xml index d7d5d1a..9824b37 100644 --- a/doc_classes/BTState.xml +++ b/doc_classes/BTState.xml @@ -9,10 +9,10 @@ - - + + - Returns the root task of the instantiated behavior tree. + Returns the behavior tree instance. diff --git a/doc_classes/BehaviorTree.xml b/doc_classes/BehaviorTree.xml index 7cd61fc..16b900f 100644 --- a/doc_classes/BehaviorTree.xml +++ b/doc_classes/BehaviorTree.xml @@ -35,12 +35,12 @@ - + - Instantiates the behavior tree and returns the root [BTTask]. [param scene_root] should be the root node of the scene that the Behavior Tree will be used in (e.g., the owner of the node that contains the behavior tree). + Instantiates the behavior tree and returns [BTInstance]. [param scene_root] should be the root node of the scene that the Behavior Tree will be used in (e.g., the owner of the node that contains the behavior tree instance). diff --git a/doc_classes/BehaviorTreeData.xml b/doc_classes/BehaviorTreeData.xml index ae8a1e1..203f059 100644 --- a/doc_classes/BehaviorTreeData.xml +++ b/doc_classes/BehaviorTreeData.xml @@ -10,12 +10,12 @@ - + - + - Returns current state of the [param tree_instance] encoded as a [BehaviorTreeData], suitable for use with [BehaviorTreeView]. - Behavior tree instance can be acquired with [method BTPlayer.get_tree_instance]. + Returns current state of the [param bt_instance] encoded as a [BehaviorTreeData], suitable for use with [BehaviorTreeView]. + Behavior tree instance can be acquired with [method BTPlayer.get_bt_instance].