limboai/doc_classes/LimboHSM.xml

89 lines
3.3 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<class name="LimboHSM" inherits="LimboState" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
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.
</description>
<tutorials>
</tutorials>
<methods>
<method name="add_transition">
<return type="void" />
<param index="0" name="p_from_state" type="Node" />
<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.
</description>
</method>
<method name="get_active_state" qualifiers="const">
<return type="LimboState" />
<description>
Returns active state.
</description>
</method>
<method name="get_leaf_state" qualifiers="const">
<return type="LimboState" />
<description>
Returns the leaf state that is currently active in HSM.
</description>
</method>
<method name="initialize">
<return type="void" />
<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.
</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].
</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].
</description>
</method>
</methods>
<members>
<member name="ANYSTATE" type="LimboState" setter="" getter="anystate">
Useful to define 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.
</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].
</member>
</members>
<signals>
<signal name="state_changed">
<param index="0" name="p_state" type="LimboState" />
<description>
Emitted when state is changed.
</description>
</signal>
</signals>
<constants>
<constant name="IDLE" value="0" enum="UpdateMode">
Update state machine during idle process.
</constant>
<constant name="PHYSICS" value="1" enum="UpdateMode">
Update state machine during physics process.
</constant>
<constant name="MANUAL" value="2" enum="UpdateMode">
Update state machine manually by calling [method update] from a script.
</constant>
</constants>
</class>