Update class docs

This commit is contained in:
Serhii Snitsaruk 2024-08-03 13:14:31 +02:00
parent 6c794d6a7e
commit 9abfe4ce95
No known key found for this signature in database
GPG Key ID: A965EF8799FFEC2D
11 changed files with 319 additions and 58 deletions

View File

@ -83,6 +83,7 @@ def get_doc_classes():
"BTDynamicSequence",
"BTFail",
"BTForEach",
"BTInstance",
"BTInvert",
"BTNewScope",
"BTParallel",

View File

@ -62,7 +62,7 @@ Methods
+-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`BTTask<class_BTTask>` | :ref:`get_root_task<class_BehaviorTree_method_get_root_task>`\ (\ ) |const| |
+-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`BTTask<class_BTTask>` | :ref:`instantiate<class_BehaviorTree_method_instantiate>`\ (\ agent\: ``Node``, blackboard\: :ref:`Blackboard<class_Blackboard>`, scene_root\: ``Node``\ ) |const| |
| :ref:`BTInstance<class_BTInstance>` | :ref:`instantiate<class_BehaviorTree_method_instantiate>`\ (\ agent\: ``Node``, blackboard\: :ref:`Blackboard<class_Blackboard>`, scene_root\: ``Node``\ ) |const| |
+-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_root_task<class_BehaviorTree_method_set_root_task>`\ (\ task\: :ref:`BTTask<class_BTTask>`\ ) |
+-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
@ -172,9 +172,9 @@ Returns the root task of the BehaviorTree resource.
.. rst-class:: classref-method
:ref:`BTTask<class_BTTask>` **instantiate**\ (\ agent\: ``Node``, blackboard\: :ref:`Blackboard<class_Blackboard>`, scene_root\: ``Node``\ ) |const| :ref:`🔗<class_BehaviorTree_method_instantiate>`
:ref:`BTInstance<class_BTInstance>` **instantiate**\ (\ agent\: ``Node``, blackboard\: :ref:`Blackboard<class_Blackboard>`, scene_root\: ``Node``\ ) |const| :ref:`🔗<class_BehaviorTree_method_instantiate>`
Instantiates the behavior tree and returns the root :ref:`BTTask<class_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<class_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

View File

@ -31,9 +31,9 @@ Methods
.. table::
:widths: auto
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`BehaviorTreeData<class_BehaviorTreeData>` | :ref:`create_from_tree_instance<class_BehaviorTreeData_method_create_from_tree_instance>`\ (\ tree_instance\: :ref:`BTTask<class_BTTask>`\ ) |static| |
+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
+-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`BehaviorTreeData<class_BehaviorTreeData>` | :ref:`create_from_bt_instance<class_BehaviorTreeData_method_create_from_bt_instance>`\ (\ bt_instance\: :ref:`BTInstance<class_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<class_BehaviorTreeData>` **create_from_tree_instance**\ (\ tree_instance\: :ref:`BTTask<class_BTTask>`\ ) |static| :ref:`🔗<class_BehaviorTreeData_method_create_from_tree_instance>`
:ref:`BehaviorTreeData<class_BehaviorTreeData>` **create_from_bt_instance**\ (\ bt_instance\: :ref:`BTInstance<class_BTInstance>`\ ) |static| :ref:`🔗<class_BehaviorTreeData_method_create_from_bt_instance>`
Returns current state of the ``tree_instance`` encoded as a **BehaviorTreeData**, suitable for use with :ref:`BehaviorTreeView<class_BehaviorTreeView>`.
Returns current state of the ``bt_instance`` encoded as a **BehaviorTreeData**, suitable for use with :ref:`BehaviorTreeView<class_BehaviorTreeView>`.
Behavior tree instance can be acquired with :ref:`BTPlayer.get_tree_instance<class_BTPlayer_method_get_tree_instance>`.
Behavior tree instance can be acquired with :ref:`BTPlayer.get_bt_instance<class_BTPlayer_method_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.)`

View File

@ -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 <doc_updating_the_class_reference>`!
.. rst-class:: classref-reftable-group
Properties
----------
.. table::
:widths: auto
+----------+---------------------------------------------------------------------------+-----------+
| ``bool`` | :ref:`monitor_performance<class_BTInstance_property_monitor_performance>` | ``false`` |
+----------+---------------------------------------------------------------------------+-----------+
.. rst-class:: classref-reftable-group
Methods
-------
.. table::
:widths: auto
+-------------------------------+-----------------------------------------------------------------------------------------+
| :ref:`Status<enum_BT_Status>` | :ref:`get_last_status<class_BTInstance_method_get_last_status>`\ (\ ) |const| |
+-------------------------------+-----------------------------------------------------------------------------------------+
| ``Node`` | :ref:`get_owner_node<class_BTInstance_method_get_owner_node>`\ (\ ) |const| |
+-------------------------------+-----------------------------------------------------------------------------------------+
| :ref:`BTTask<class_BTTask>` | :ref:`get_root_task<class_BTInstance_method_get_root_task>`\ (\ ) |const| |
+-------------------------------+-----------------------------------------------------------------------------------------+
| ``String`` | :ref:`get_source_bt_path<class_BTInstance_method_get_source_bt_path>`\ (\ ) |const| |
+-------------------------------+-----------------------------------------------------------------------------------------+
| |void| | :ref:`register_with_debugger<class_BTInstance_method_register_with_debugger>`\ (\ ) |
+-------------------------------+-----------------------------------------------------------------------------------------+
| |void| | :ref:`unregister_with_debugger<class_BTInstance_method_unregister_with_debugger>`\ (\ ) |
+-------------------------------+-----------------------------------------------------------------------------------------+
| :ref:`Status<enum_BT_Status>` | :ref:`update<class_BTInstance_method_update>`\ (\ delta\: ``float``\ ) |
+-------------------------------+-----------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Signals
-------
.. _class_BTInstance_signal_freed:
.. rst-class:: classref-signal
**freed**\ (\ ) :ref:`🔗<class_BTInstance_signal_freed>`
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:`🔗<class_BTInstance_signal_updated>`
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:`🔗<class_BTInstance_property_monitor_performance>`
.. 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<enum_BT_Status>` **get_last_status**\ (\ ) |const| :ref:`🔗<class_BTInstance_method_get_last_status>`
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:`🔗<class_BTInstance_method_get_owner_node>`
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<class_BTTask>` **get_root_task**\ (\ ) |const| :ref:`🔗<class_BTInstance_method_get_root_task>`
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:`🔗<class_BTInstance_method_get_source_bt_path>`
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:`🔗<class_BTInstance_method_register_with_debugger>`
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:`🔗<class_BTInstance_method_unregister_with_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.
.. rst-class:: classref-item-separator
----
.. _class_BTInstance_method_update:
.. rst-class:: classref-method
:ref:`Status<enum_BT_Status>` **update**\ (\ delta\: ``float``\ ) :ref:`🔗<class_BTInstance_method_update>`
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.)`

View File

@ -55,15 +55,13 @@ Methods
.. table::
:widths: auto
+-----------------------------+-----------------------------------------------------------------------------+
| ``int`` | :ref:`get_last_status<class_BTPlayer_method_get_last_status>`\ (\ ) |const| |
+-----------------------------+-----------------------------------------------------------------------------+
| :ref:`BTTask<class_BTTask>` | :ref:`get_tree_instance<class_BTPlayer_method_get_tree_instance>`\ (\ ) |
+-----------------------------+-----------------------------------------------------------------------------+
| |void| | :ref:`restart<class_BTPlayer_method_restart>`\ (\ ) |
+-----------------------------+-----------------------------------------------------------------------------+
| |void| | :ref:`update<class_BTPlayer_method_update>`\ (\ delta\: ``float``\ ) |
+-----------------------------+-----------------------------------------------------------------------------+
+-------------------------------------+----------------------------------------------------------------------+
| :ref:`BTInstance<class_BTInstance>` | :ref:`get_bt_instance<class_BTPlayer_method_get_bt_instance>`\ (\ ) |
+-------------------------------------+----------------------------------------------------------------------+
| |void| | :ref:`restart<class_BTPlayer_method_restart>`\ (\ ) |
+-------------------------------------+----------------------------------------------------------------------+
| |void| | :ref:`update<class_BTPlayer_method_update>`\ (\ delta\: ``float``\ ) |
+-------------------------------------+----------------------------------------------------------------------+
.. rst-class:: classref-section-separator
@ -265,25 +263,13 @@ Determines when the behavior tree is executed. See :ref:`UpdateMode<enum_BTPlaye
Method Descriptions
-------------------
.. _class_BTPlayer_method_get_last_status:
.. _class_BTPlayer_method_get_bt_instance:
.. rst-class:: classref-method
``int`` **get_last_status**\ (\ ) |const| :ref:`🔗<class_BTPlayer_method_get_last_status>`
:ref:`BTInstance<class_BTInstance>` **get_bt_instance**\ (\ ) :ref:`🔗<class_BTPlayer_method_get_bt_instance>`
Returns the behavior tree's last execution status. See :ref:`Status<enum_BT_Status>`.
.. rst-class:: classref-item-separator
----
.. _class_BTPlayer_method_get_tree_instance:
.. rst-class:: classref-method
:ref:`BTTask<class_BTTask>` **get_tree_instance**\ (\ ) :ref:`🔗<class_BTPlayer_method_get_tree_instance>`
Returns the root task of the instantiated behavior tree.
Returns the behavior tree instance.
.. rst-class:: classref-item-separator

View File

@ -45,9 +45,9 @@ Methods
.. table::
:widths: auto
+-----------------------------+--------------------------------------------------------------------------------+
| :ref:`BTTask<class_BTTask>` | :ref:`get_tree_instance<class_BTState_method_get_tree_instance>`\ (\ ) |const| |
+-----------------------------+--------------------------------------------------------------------------------+
+-------------------------------------+----------------------------------------------------------------------------+
| :ref:`BTInstance<class_BTInstance>` | :ref:`get_bt_instance<class_BTState_method_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<class_BTTask>` **get_tree_instance**\ (\ ) |const| :ref:`🔗<class_BTState_method_get_tree_instance>`
:ref:`BTInstance<class_BTInstance>` **get_bt_instance**\ (\ ) |const| :ref:`🔗<class_BTState_method_get_bt_instance>`
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.)`

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BTInstance" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<methods>
<method name="get_last_status" qualifiers="const">
<return type="int" enum="BT.Status" />
<description>
Returns the execution status of the last update.
</description>
</method>
<method name="get_owner_node" qualifiers="const">
<return type="Node" />
<description>
Returns the scene [Node] that owns this behavior tree instance.
</description>
</method>
<method name="get_root_task" qualifiers="const">
<return type="BTTask" />
<description>
Returns the root task of the behavior tree instance.
</description>
</method>
<method name="get_source_bt_path" qualifiers="const">
<return type="String" />
<description>
Returns the file path to the behavior tree resource that was used to create this instance.
</description>
</method>
<method name="register_with_debugger">
<return type="void" />
<description>
Registers the behavior tree instance with the debugger.
</description>
</method>
<method name="unregister_with_debugger">
<return type="void" />
<description>
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.
</description>
</method>
<method name="update">
<return type="int" enum="BT.Status" />
<param index="0" name="delta" type="float" />
<description>
Ticks the behavior tree instance and returns its status.
</description>
</method>
</methods>
<members>
<member name="monitor_performance" type="bool" setter="set_monitor_performance" getter="get_monitor_performance" default="false">
If [code]true[/code], adds a performance monitor for this instance to "Debugger-&gt;Monitors" in the editor.
</member>
</members>
<signals>
<signal name="freed">
<description>
Emitted when the behavior tree instance is freed. Used by debugger to unregister.
</description>
</signal>
<signal name="updated">
<param index="0" name="status" type="int" />
<description>
Emitted when the behavior tree instance has finished updating.
</description>
</signal>
</signals>
</class>

View File

@ -10,16 +10,10 @@
<tutorials>
</tutorials>
<methods>
<method name="get_last_status" qualifiers="const">
<return type="int" />
<method name="get_bt_instance">
<return type="BTInstance" />
<description>
Returns the behavior tree's last execution status. See [enum BT.Status].
</description>
</method>
<method name="get_tree_instance">
<return type="BTTask" />
<description>
Returns the root task of the instantiated behavior tree.
Returns the behavior tree instance.
</description>
</method>
<method name="restart">

View File

@ -9,10 +9,10 @@
<tutorials>
</tutorials>
<methods>
<method name="get_tree_instance" qualifiers="const">
<return type="BTTask" />
<method name="get_bt_instance" qualifiers="const">
<return type="BTInstance" />
<description>
Returns the root task of the instantiated behavior tree.
Returns the behavior tree instance.
</description>
</method>
</methods>

View File

@ -35,12 +35,12 @@
</description>
</method>
<method name="instantiate" qualifiers="const">
<return type="BTTask" />
<return type="BTInstance" />
<param index="0" name="agent" type="Node" />
<param index="1" name="blackboard" type="Blackboard" />
<param index="2" name="scene_root" type="Node" />
<description>
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).
</description>
</method>
<method name="set_root_task">

View File

@ -10,12 +10,12 @@
<tutorials>
</tutorials>
<methods>
<method name="create_from_tree_instance" qualifiers="static">
<method name="create_from_bt_instance" qualifiers="static">
<return type="BehaviorTreeData" />
<param index="0" name="tree_instance" type="BTTask" />
<param index="0" name="bt_instance" type="BTInstance" />
<description>
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].
</description>
</method>
</methods>