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). Event-based Hierarchical State Machine (HSM).
</brief_description> </brief_description>
<description> <description>
Event-based Hierarchical State Machine (HSM). 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.
Manages [LimboState] instances and transitions between them. LimboHSM is a [LimboState] itself, and can be a child of another LimboHSM instance.
</description> </description>
<tutorials> <tutorials>
</tutorials> </tutorials>
@ -16,19 +15,19 @@
<param index="1" name="p_to_state" type="Node" /> <param index="1" name="p_to_state" type="Node" />
<param index="2" name="p_event" type="String" /> <param index="2" name="p_event" type="String" />
<description> <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> </description>
</method> </method>
<method name="get_active_state" qualifiers="const"> <method name="get_active_state" qualifiers="const">
<return type="LimboState" /> <return type="LimboState" />
<description> <description>
Returns active state. Returns the currently active substate.
</description> </description>
</method> </method>
<method name="get_leaf_state" qualifiers="const"> <method name="get_leaf_state" qualifiers="const">
<return type="LimboState" /> <return type="LimboState" />
<description> <description>
Returns the leaf state that is currently active in HSM. Returns the currently active leaf state within the state machine.
</description> </description>
</method> </method>
<method name="initialize"> <method name="initialize">
@ -36,53 +35,52 @@
<param index="0" name="p_agent" type="Node" /> <param index="0" name="p_agent" type="Node" />
<param index="1" name="p_parent_scope" type="Blackboard" default="null" /> <param index="1" name="p_parent_scope" type="Blackboard" default="null" />
<description> <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> </description>
</method> </method>
<method name="set_active"> <method name="set_active">
<return type="void" /> <return type="void" />
<param index="0" name="p_active" type="bool" /> <param index="0" name="p_active" type="bool" />
<description> <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> </description>
</method> </method>
<method name="update"> <method name="update">
<return type="void" /> <return type="void" />
<param index="0" name="p_delta" type="float" /> <param index="0" name="p_delta" type="float" />
<description> <description>
Calls [method LimboState._update] on itself and on the active substate. Call propagates down to the leaf state. 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].
It is called automatically, if [member update_mode] is not set to [constant MANUAL].
</description> </description>
</method> </method>
</methods> </methods>
<members> <members>
<member name="ANYSTATE" type="LimboState" setter="" getter="anystate"> <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>
<member name="initial_state" type="LimboState" setter="set_initial_state" getter="get_initial_state"> <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>
<member name="update_mode" type="int" setter="set_update_mode" getter="get_update_mode" enum="LimboHSM.UpdateMode" default="1"> <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> </member>
</members> </members>
<signals> <signals>
<signal name="state_changed"> <signal name="state_changed">
<param index="0" name="p_state" type="LimboState" /> <param index="0" name="p_state" type="LimboState" />
<description> <description>
Emitted when state is changed. Emitted when the currently active substate is switched to a different substate.
</description> </description>
</signal> </signal>
</signals> </signals>
<constants> <constants>
<constant name="IDLE" value="0" enum="UpdateMode"> <constant name="IDLE" value="0" enum="UpdateMode">
Update state machine during idle process. Update the state machine during the idle process.
</constant> </constant>
<constant name="PHYSICS" value="1" enum="UpdateMode"> <constant name="PHYSICS" value="1" enum="UpdateMode">
Update state machine during physics process. Update the state machine during the physics process.
</constant> </constant>
<constant name="MANUAL" value="2" enum="UpdateMode"> <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> </constant>
</constants> </constants>
</class> </class>

View File

@ -12,36 +12,42 @@
<return type="String" /> <return type="String" />
<param index="0" name="p_variable" type="String" /> <param index="0" name="p_variable" type="String" />
<description> <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> </description>
</method> </method>
<method name="get_status_name" qualifiers="const"> <method name="get_status_name" qualifiers="const">
<return type="String" /> <return type="String" />
<param index="0" name="p_status" type="int" /> <param index="0" name="p_status" type="int" />
<description> <description>
Returns name of a [BTTask] status code. Returns a name of a [BTTask] status code.
</description> </description>
</method> </method>
<method name="get_task_icon" qualifiers="const"> <method name="get_task_icon" qualifiers="const">
<return type="Texture2D" /> <return type="Texture2D" />
<param index="0" name="p_class_or_script_path" type="String" /> <param index="0" name="p_class_or_script_path" type="String" />
<description> <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> </description>
</method> </method>
</methods> </methods>
<constants> <constants>
<constant name="CHECK_EQUAL" value="0" enum="CheckType"> <constant name="CHECK_EQUAL" value="0" enum="CheckType">
Equality Check.
</constant> </constant>
<constant name="CHECK_LESS_THAN" value="1" enum="CheckType"> <constant name="CHECK_LESS_THAN" value="1" enum="CheckType">
Less Than Check.
</constant> </constant>
<constant name="CHECK_LESS_THAN_OR_EQUAL" value="2" enum="CheckType"> <constant name="CHECK_LESS_THAN_OR_EQUAL" value="2" enum="CheckType">
Less Than or Equal To Check.
</constant> </constant>
<constant name="CHECK_GREATER_THAN" value="3" enum="CheckType"> <constant name="CHECK_GREATER_THAN" value="3" enum="CheckType">
Greater Than Check.
</constant> </constant>
<constant name="CHECK_GREATER_THAN_OR_EQUAL" value="4" enum="CheckType"> <constant name="CHECK_GREATER_THAN_OR_EQUAL" value="4" enum="CheckType">
Greater Than or Equal To Check
</constant> </constant>
<constant name="CHECK_NOT_EQUAL" value="5" enum="CheckType"> <constant name="CHECK_NOT_EQUAL" value="5" enum="CheckType">
Inequality Check.
</constant> </constant>
</constants> </constants>
</class> </class>