Improve docs for LimboHSM & LimboUtility

This commit is contained in:
Serhii Snitsaruk 2023-10-26 16:16:00 +02:00
parent 446925adac
commit 14c162de39
2 changed files with 23 additions and 19 deletions

View File

@ -4,8 +4,7 @@
Event-based Hierarchical State Machine (HSM).
</brief_description>
<description>
Event-based Hierarchical State Machine (HSM).
Manages [LimboState] instances and transitions between them. LimboHSM is a [LimboState] itself, and can be a child of another LimboHSM instance.
Event-based Hierarchical State Machine (HSM) that manages [LimboState] instances and facilitates transitions between them. LimboHSM is a [LimboState] in itself and can also serve as a child of another LimboHSM node.
</description>
<tutorials>
</tutorials>
@ -16,19 +15,19 @@
<param index="1" name="p_to_state" type="Node" />
<param index="2" name="p_event" type="String" />
<description>
Adds a transition from one state to another when [code]p_event[/code] is dispatched.
Establishes a transition from one state to another when [code]p_event[/code] is dispatched. Both [code]p_from_state[/code] and [code]p_to_state[/code] must be immediate children of this state.
</description>
</method>
<method name="get_active_state" qualifiers="const">
<return type="LimboState" />
<description>
Returns active state.
Returns the currently active substate.
</description>
</method>
<method name="get_leaf_state" qualifiers="const">
<return type="LimboState" />
<description>
Returns the leaf state that is currently active in HSM.
Returns the currently active leaf state within the state machine.
</description>
</method>
<method name="initialize">
@ -36,53 +35,52 @@
<param index="0" name="p_agent" type="Node" />
<param index="1" name="p_parent_scope" type="Blackboard" default="null" />
<description>
Initializes state and calls [code]_setup[/code] for itself and every substate.
Initiates the state and calls [code]_setup[/code] for both itself and all substates.
</description>
</method>
<method name="set_active">
<return type="void" />
<param index="0" name="p_active" type="bool" />
<description>
If [code]true[/code], changes state to [member initial_state] and enables state processing depending on [member update_mode].
When set to [code]true[/code], switches the state to [member initial_state] and activates state processing according to [member update_mode].
</description>
</method>
<method name="update">
<return type="void" />
<param index="0" name="p_delta" type="float" />
<description>
Calls [method LimboState._update] on itself and on the active substate. Call propagates down to the leaf state.
It is called automatically, if [member update_mode] is not set to [constant MANUAL].
Calls [method LimboState._update] on itself and the active substate, with the call cascading down to the leaf state. This method is automatically triggered if [member update_mode] is not set to [constant MANUAL].
</description>
</method>
</methods>
<members>
<member name="ANYSTATE" type="LimboState" setter="" getter="anystate">
Useful to define a transition from any state.
Useful for defining a transition from any state.
</member>
<member name="initial_state" type="LimboState" setter="set_initial_state" getter="get_initial_state">
A state that becomes active when state machine is activated by [method set_active] method.
The substate that becomes active when the state machine is activated using the [method set_active] method. If not explicitly set, the first child of the LimboHSM will be considered the initial state.
</member>
<member name="update_mode" type="int" setter="set_update_mode" getter="get_update_mode" enum="LimboHSM.UpdateMode" default="1">
Determines when state machine is updated. See [enum UpdateMode].
Specifies when the state machine should be updated. See [enum UpdateMode].
</member>
</members>
<signals>
<signal name="state_changed">
<param index="0" name="p_state" type="LimboState" />
<description>
Emitted when state is changed.
Emitted when the currently active substate is switched to a different substate.
</description>
</signal>
</signals>
<constants>
<constant name="IDLE" value="0" enum="UpdateMode">
Update state machine during idle process.
Update the state machine during the idle process.
</constant>
<constant name="PHYSICS" value="1" enum="UpdateMode">
Update state machine during physics process.
Update the state machine during the physics process.
</constant>
<constant name="MANUAL" value="2" enum="UpdateMode">
Update state machine manually by calling [method update] from a script.
Manually update the state machine by calling [method update] from a script.
</constant>
</constants>
</class>

View File

@ -12,36 +12,42 @@
<return type="String" />
<param index="0" name="p_variable" type="String" />
<description>
Returns a string with a [Blackboard] variable name ready to be displayed or printed to console.
Produces a string with a [Blackboard] variable name that is formatted for display or console output.
</description>
</method>
<method name="get_status_name" qualifiers="const">
<return type="String" />
<param index="0" name="p_status" type="int" />
<description>
Returns name of a [BTTask] status code.
Returns a name of a [BTTask] status code.
</description>
</method>
<method name="get_task_icon" qualifiers="const">
<return type="Texture2D" />
<param index="0" name="p_class_or_script_path" type="String" />
<description>
Returns the icon texture associated with a task, given its class name or script resource path.
Returns the icon texture associated with a task based on its class name or script resource path.
</description>
</method>
</methods>
<constants>
<constant name="CHECK_EQUAL" value="0" enum="CheckType">
Equality Check.
</constant>
<constant name="CHECK_LESS_THAN" value="1" enum="CheckType">
Less Than Check.
</constant>
<constant name="CHECK_LESS_THAN_OR_EQUAL" value="2" enum="CheckType">
Less Than or Equal To Check.
</constant>
<constant name="CHECK_GREATER_THAN" value="3" enum="CheckType">
Greater Than Check.
</constant>
<constant name="CHECK_GREATER_THAN_OR_EQUAL" value="4" enum="CheckType">
Greater Than or Equal To Check
</constant>
<constant name="CHECK_NOT_EQUAL" value="5" enum="CheckType">
Inequality Check.
</constant>
</constants>
</class>