From dd3eebabf1d233868789eabea9aa899064e44dcc Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Wed, 14 Feb 2024 20:34:18 +0100 Subject: [PATCH] Doc: Update class rst --- doc/source/classes/class_bbfloat.rst | 23 +++++++ doc/source/classes/class_behaviortreedata.rst | 63 +++++++++++++++++ doc/source/classes/class_behaviortreeview.rst | 59 ++++++++++++++++ doc/source/classes/class_blackboard.rst | 68 +++++++++++++------ doc/source/classes/class_btplayer.rst | 28 ++++++-- doc/source/classes/class_btrunlimit.rst | 64 ++++++++++++++++- doc/source/classes/class_btstate.rst | 29 ++++++++ doc/source/classes/class_limbohsm.rst | 28 ++++---- doc/source/classes/class_limboutility.rst | 14 ++++ 9 files changed, 332 insertions(+), 44 deletions(-) create mode 100644 doc/source/classes/class_bbfloat.rst create mode 100644 doc/source/classes/class_behaviortreedata.rst create mode 100644 doc/source/classes/class_behaviortreeview.rst diff --git a/doc/source/classes/class_bbfloat.rst b/doc/source/classes/class_bbfloat.rst new file mode 100644 index 0000000..078ff0d --- /dev/null +++ b/doc/source/classes/class_bbfloat.rst @@ -0,0 +1,23 @@ +:github_url: hide + +.. DO NOT EDIT THIS FILE!!! +.. Generated automatically from Godot engine sources. +.. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py. +.. XML source: https://github.com/godotengine/godot/tree/4.2/modules/limboai/doc_classes/BBFloat.xml. + +.. _class_BBFloat: + +BBFloat +======= + +**Inherits:** :ref:`BBParam` + +Float-type parameter for :ref:`BehaviorTree` tasks. See :ref:`BBParam`. + +.. |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.)` diff --git a/doc/source/classes/class_behaviortreedata.rst b/doc/source/classes/class_behaviortreedata.rst new file mode 100644 index 0000000..abac5a2 --- /dev/null +++ b/doc/source/classes/class_behaviortreedata.rst @@ -0,0 +1,63 @@ +:github_url: hide + +.. DO NOT EDIT THIS FILE!!! +.. Generated automatically from Godot engine sources. +.. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py. +.. XML source: https://github.com/godotengine/godot/tree/4.2/modules/limboai/doc_classes/BehaviorTreeData.xml. + +.. _class_BehaviorTreeData: + +BehaviorTreeData +================ + +**Inherits:** + +Represents current state of a :ref:`BehaviorTree` instance. + +.. rst-class:: classref-introduction-group + +Description +----------- + +This class is used by the LimboAI debugger for the serialization and deserialization of :ref:`BehaviorTree` instance data. + +Additionally, it can be used with :ref:`BehaviorTreeView` to visualize the current state of a :ref:`BehaviorTree` instance. It is meant to be utilized in custom in-game tools. + +.. rst-class:: classref-reftable-group + +Methods +------- + +.. table:: + :widths: auto + + +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`BehaviorTreeData` | :ref:`create_from_tree_instance` **(** :ref:`BTTask` p_tree_instance **)** |static| | + +-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Method Descriptions +------------------- + +.. _class_BehaviorTreeData_method_create_from_tree_instance: + +.. rst-class:: classref-method + +:ref:`BehaviorTreeData` **create_from_tree_instance** **(** :ref:`BTTask` p_tree_instance **)** |static| + +Returns current state of the ``p_tree_instance`` encoded as a **BehaviorTreeData**, suitable for use with :ref:`BehaviorTreeView`. + +Behavior tree instance can be acquired with :ref:`BTPlayer.get_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.)` +.. |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.)` diff --git a/doc/source/classes/class_behaviortreeview.rst b/doc/source/classes/class_behaviortreeview.rst new file mode 100644 index 0000000..43997dd --- /dev/null +++ b/doc/source/classes/class_behaviortreeview.rst @@ -0,0 +1,59 @@ +:github_url: hide + +.. DO NOT EDIT THIS FILE!!! +.. Generated automatically from Godot engine sources. +.. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py. +.. XML source: https://github.com/godotengine/godot/tree/4.2/modules/limboai/doc_classes/BehaviorTreeView.xml. + +.. _class_BehaviorTreeView: + +BehaviorTreeView +================ + +**Inherits:** + +Visualizes the current state of a :ref:`BehaviorTree` instance. + +.. rst-class:: classref-introduction-group + +Description +----------- + +Visualizes the current state of a :ref:`BehaviorTree` instance. See also :ref:`BehaviorTreeData`. + +.. rst-class:: classref-reftable-group + +Methods +------- + +.. table:: + :widths: auto + + +------+------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`update_tree` **(** :ref:`BehaviorTreeData` p_behavior_tree_data **)** | + +------+------------------------------------------------------------------------------------------------------------------------------------------------+ + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Method Descriptions +------------------- + +.. _class_BehaviorTreeView_method_update_tree: + +.. rst-class:: classref-method + +void **update_tree** **(** :ref:`BehaviorTreeData` p_behavior_tree_data **)** + +Updates the representation of a :ref:`BehaviorTree` instance. See also :ref:`BehaviorTreeData`. + +.. |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.)` diff --git a/doc/source/classes/class_blackboard.rst b/doc/source/classes/class_blackboard.rst index c21130b..5495e7f 100644 --- a/doc/source/classes/class_blackboard.rst +++ b/doc/source/classes/class_blackboard.rst @@ -33,23 +33,27 @@ Methods .. table:: :widths: auto - +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`erase_var` **(** String p_name **)** | - +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Blackboard` | :ref:`get_parent_scope` **(** **)** |const| | - +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ - | Variant | :ref:`get_var` **(** String p_name, Variant p_default=null **)** |const| | - +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ - | bool | :ref:`has_var` **(** String p_name **)** |const| | - +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`prefetch_nodepath_vars` **(** Node p_node **)** | - +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_parent_scope` **(** :ref:`Blackboard` p_blackboard **)** | - +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_var` **(** String p_name, Variant p_value **)** | - +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Blackboard` | :ref:`top` **(** **)** |const| | - +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ + +-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`bind_var_to_property` **(** String p_name, Object p_object, StringName p_property **)** | + +-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`erase_var` **(** String p_name **)** | + +-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Blackboard` | :ref:`get_parent_scope` **(** **)** |const| | + +-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ + | Variant | :ref:`get_var` **(** String p_name, Variant p_default=null, bool p_complain=true **)** |const| | + +-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ + | bool | :ref:`has_var` **(** String p_name **)** |const| | + +-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`prefetch_nodepath_vars` **(** Node p_node **)** | + +-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_parent_scope` **(** :ref:`Blackboard` p_blackboard **)** | + +-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_var` **(** String p_name, Variant p_value **)** | + +-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Blackboard` | :ref:`top` **(** **)** |const| | + +-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`unbind_var` **(** String p_name **)** | + +-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -60,6 +64,18 @@ Methods Method Descriptions ------------------- +.. _class_Blackboard_method_bind_var_to_property: + +.. rst-class:: classref-method + +void **bind_var_to_property** **(** String p_name, Object p_object, StringName p_property **)** + +Establish a binding between a variable and the object's property specified by ``p_property`` and ``p_object``. Changes to the variable update the property, and vice versa. + +.. rst-class:: classref-item-separator + +---- + .. _class_Blackboard_method_erase_var: .. rst-class:: classref-method @@ -88,9 +104,9 @@ Returns a Blackboard that serves as the parent scope for this instance. .. rst-class:: classref-method -Variant **get_var** **(** String p_name, Variant p_default=null **)** |const| +Variant **get_var** **(** String p_name, Variant p_default=null, bool p_complain=true **)** |const| -Returns variable value. +Returns variable value or ``p_default`` if variable doesn't exist. If ``p_complain`` is ``true``, an error will be printed if variable doesn't exist. .. rst-class:: classref-item-separator @@ -102,7 +118,7 @@ Returns variable value. bool **has_var** **(** String p_name **)** |const| -Returns ``true`` if the Blackboard contains the ``p_key`` variable, including the parent scopes. +Returns ``true`` if the Blackboard contains the ``p_name`` variable, including the parent scopes. .. rst-class:: classref-item-separator @@ -152,6 +168,18 @@ Assigns a value to a Blackboard variable. Returns the topmost **Blackboard** in the scope chain. +.. rst-class:: classref-item-separator + +---- + +.. _class_Blackboard_method_unbind_var: + +.. rst-class:: classref-method + +void **unbind_var** **(** String p_name **)** + +Remove binding from a variable. + .. |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.)` diff --git a/doc/source/classes/class_btplayer.rst b/doc/source/classes/class_btplayer.rst index 4bb23ea..9fa4aa9 100644 --- a/doc/source/classes/class_btplayer.rst +++ b/doc/source/classes/class_btplayer.rst @@ -55,13 +55,15 @@ Methods .. table:: :widths: auto - +------+-----------------------------------------------------------------------------------+ - | int | :ref:`get_last_status` **(** **)** |const| | - +------+-----------------------------------------------------------------------------------+ - | void | :ref:`restart` **(** **)** | - +------+-----------------------------------------------------------------------------------+ - | void | :ref:`update` **(** float p_delta **)** | - +------+-----------------------------------------------------------------------------------+ + +-----------------------------+-----------------------------------------------------------------------------------+ + | int | :ref:`get_last_status` **(** **)** |const| | + +-----------------------------+-----------------------------------------------------------------------------------+ + | :ref:`BTTask` | :ref:`get_tree_instance` **(** **)** | + +-----------------------------+-----------------------------------------------------------------------------------+ + | void | :ref:`restart` **(** **)** | + +-----------------------------+-----------------------------------------------------------------------------------+ + | void | :ref:`update` **(** float p_delta **)** | + +-----------------------------+-----------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -275,6 +277,18 @@ Returns the behavior tree's last execution status. See :ref:`Status` **get_tree_instance** **(** **)** + +Returns the root task of the instantiated behavior tree. + +.. rst-class:: classref-item-separator + +---- + .. _class_BTPlayer_method_restart: .. rst-class:: classref-method diff --git a/doc/source/classes/class_btrunlimit.rst b/doc/source/classes/class_btrunlimit.rst index 64e7762..0eadc73 100644 --- a/doc/source/classes/class_btrunlimit.rst +++ b/doc/source/classes/class_btrunlimit.rst @@ -31,9 +31,50 @@ Properties .. table:: :widths: auto - +-----+-------------------------------------------------------+-------+ - | int | :ref:`run_limit` | ``1`` | - +-----+-------------------------------------------------------+-------+ + +-------------------------------------------------+-------------------------------------------------------------+-------+ + | :ref:`CountPolicy` | :ref:`count_policy` | ``0`` | + +-------------------------------------------------+-------------------------------------------------------------+-------+ + | int | :ref:`run_limit` | ``1`` | + +-------------------------------------------------+-------------------------------------------------------------+-------+ + +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Enumerations +------------ + +.. _enum_BTRunLimit_CountPolicy: + +.. rst-class:: classref-enumeration + +enum **CountPolicy**: + +.. _class_BTRunLimit_constant_COUNT_SUCCESSFUL: + +.. rst-class:: classref-enumeration-constant + +:ref:`CountPolicy` **COUNT_SUCCESSFUL** = ``0`` + +Count only successful runs towards the limit. + +.. _class_BTRunLimit_constant_COUNT_FAILED: + +.. rst-class:: classref-enumeration-constant + +:ref:`CountPolicy` **COUNT_FAILED** = ``1`` + +Count only failed runs towards the limit. + +.. _class_BTRunLimit_constant_COUNT_ALL: + +.. rst-class:: classref-enumeration-constant + +:ref:`CountPolicy` **COUNT_ALL** = ``2`` + +Count successful and failed runs towards the limit. .. rst-class:: classref-section-separator @@ -44,6 +85,23 @@ Properties Property Descriptions --------------------- +.. _class_BTRunLimit_property_count_policy: + +.. rst-class:: classref-property + +:ref:`CountPolicy` **count_policy** = ``0`` + +.. rst-class:: classref-property-setget + +- void **set_count_policy** **(** :ref:`CountPolicy` value **)** +- :ref:`CountPolicy` **get_count_policy** **(** **)** + +Which runs should be counted towards the limit: successful, failed, or all? + +.. rst-class:: classref-item-separator + +---- + .. _class_BTRunLimit_property_run_limit: .. rst-class:: classref-property diff --git a/doc/source/classes/class_btstate.rst b/doc/source/classes/class_btstate.rst index 686deec..cfe4e6e 100644 --- a/doc/source/classes/class_btstate.rst +++ b/doc/source/classes/class_btstate.rst @@ -37,6 +37,18 @@ Properties | String | :ref:`success_event` | ``"success"`` | +-----------------------------------------+------------------------------------------------------------+---------------+ +.. rst-class:: classref-reftable-group + +Methods +------- + +.. table:: + :widths: auto + + +-----------------------------+--------------------------------------------------------------------------------------+ + | :ref:`BTTask` | :ref:`get_tree_instance` **(** **)** |const| | + +-----------------------------+--------------------------------------------------------------------------------------+ + .. rst-class:: classref-section-separator ---- @@ -93,6 +105,23 @@ String **success_event** = ``"success"`` HSM event that will be dispatched when the behavior tree results in ``SUCCESS``. See :ref:`LimboState.dispatch`. +.. rst-class:: classref-section-separator + +---- + +.. rst-class:: classref-descriptions-group + +Method Descriptions +------------------- + +.. _class_BTState_method_get_tree_instance: + +.. rst-class:: classref-method + +:ref:`BTTask` **get_tree_instance** **(** **)** |const| + +Returns the root task of the instantiated behavior tree. + .. |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.)` diff --git a/doc/source/classes/class_limbohsm.rst b/doc/source/classes/class_limbohsm.rst index 6ceab9a..ada74a1 100644 --- a/doc/source/classes/class_limbohsm.rst +++ b/doc/source/classes/class_limbohsm.rst @@ -45,19 +45,19 @@ Methods .. table:: :widths: auto - +-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`add_transition` **(** Node p_from_state, Node p_to_state, String p_event **)** | - +-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`LimboState` | :ref:`get_active_state` **(** **)** |const| | - +-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`LimboState` | :ref:`get_leaf_state` **(** **)** |const| | - +-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`initialize` **(** Node p_agent, :ref:`Blackboard` p_parent_scope=null **)** | - +-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_active` **(** bool p_active **)** | - +-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`update` **(** float p_delta **)** | - +-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ + +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`add_transition` **(** :ref:`LimboState` p_from_state, :ref:`LimboState` p_to_state, String p_event **)** | + +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`LimboState` | :ref:`get_active_state` **(** **)** |const| | + +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`LimboState` | :ref:`get_leaf_state` **(** **)** |const| | + +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`initialize` **(** Node p_agent, :ref:`Blackboard` p_parent_scope=null **)** | + +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_active` **(** bool p_active **)** | + +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`update` **(** float p_delta **)** | + +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -183,7 +183,7 @@ Method Descriptions .. rst-class:: classref-method -void **add_transition** **(** Node p_from_state, Node p_to_state, String p_event **)** +void **add_transition** **(** :ref:`LimboState` p_from_state, :ref:`LimboState` p_to_state, String p_event **)** Establishes a transition from one state to another when ``p_event`` is dispatched. Both ``p_from_state`` and ``p_to_state`` must be immediate children of this state. diff --git a/doc/source/classes/class_limboutility.rst b/doc/source/classes/class_limboutility.rst index 2ecbfa9..83c9e72 100644 --- a/doc/source/classes/class_limboutility.rst +++ b/doc/source/classes/class_limboutility.rst @@ -22,6 +22,8 @@ Methods .. table:: :widths: auto + +-----------+-----------------------------------------------------------------------------------------------------------------+ + | String | :ref:`decorate_output_var` **(** String p_variable **)** |const| | +-----------+-----------------------------------------------------------------------------------------------------------------+ | String | :ref:`decorate_var` **(** String p_variable **)** |const| | +-----------+-----------------------------------------------------------------------------------------------------------------+ @@ -208,6 +210,18 @@ Bitwise XOR. Method Descriptions ------------------- +.. _class_LimboUtility_method_decorate_output_var: + +.. rst-class:: classref-method + +String **decorate_output_var** **(** String p_variable **)** |const| + +Just like :ref:`decorate_var`, produces a string with a :ref:`Blackboard` variable name that is formatted for display, and also adds an additional symbol to indicate that the variable is used as an output. + +.. rst-class:: classref-item-separator + +---- + .. _class_LimboUtility_method_decorate_var: .. rst-class:: classref-method