limboai/doc_classes/LimboHSM.xml

89 lines
3.4 KiB
XML
Raw Normal View History

2022-11-01 20:31:22 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
<class name="LimboHSM" inherits="LimboState" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
2022-11-04 12:27:09 +00:00
Event-based Hierarchical State Machine (HSM).
2022-11-01 20:31:22 +00:00
</brief_description>
<description>
2022-11-04 12:27:09 +00:00
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.
2022-11-01 20:31:22 +00:00
</description>
<tutorials>
</tutorials>
<methods>
<method name="add_transition">
<return type="void" />
<argument index="0" name="p_from_state" type="Node" />
<argument index="1" name="p_to_state" type="Node" />
<argument index="2" name="p_event" type="String" />
<description>
2022-11-04 12:27:09 +00:00
Adds a transition from one state to another when [code]p_event[/code] is dispatched.
2022-11-01 20:31:22 +00:00
</description>
</method>
<method name="get_active_state" qualifiers="const">
<return type="LimboState" />
<description>
2022-11-04 12:27:09 +00:00
Returns active state.
2022-11-01 20:31:22 +00:00
</description>
</method>
<method name="get_leaf_state" qualifiers="const">
<return type="LimboState" />
<description>
2022-11-04 12:27:09 +00:00
Returns the leaf state that is currently active in HSM.
2022-11-01 20:31:22 +00:00
</description>
</method>
<method name="initialize">
<return type="void" />
<argument index="0" name="p_agent" type="Object" />
<argument index="1" name="p_parent_scope" type="Blackboard" default="null" />
<description>
2022-11-04 12:27:09 +00:00
Initializes state and calls [code]_setup[/code] for itself and every substate.
2022-11-01 20:31:22 +00:00
</description>
</method>
<method name="set_active">
<return type="void" />
<argument index="0" name="p_active" type="bool" />
<description>
2022-11-04 12:27:09 +00:00
If [code]true[/code], changes state to [member initial_state] and enables state processing depending on [member update_mode].
2022-11-01 20:31:22 +00:00
</description>
</method>
<method name="update">
<return type="void" />
<argument index="0" name="p_delta" type="float" />
<description>
2022-11-04 12:27:09 +00:00
Calls [member 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].
2022-11-01 20:31:22 +00:00
</description>
</method>
</methods>
<members>
<member name="ANYSTATE" type="LimboState" setter="" getter="anystate">
2022-11-04 12:27:09 +00:00
Useful to define a transition from any state.
2022-11-01 20:31:22 +00:00
</member>
<member name="initial_state" type="LimboState" setter="set_initial_state" getter="get_initial_state">
2022-11-04 12:27:09 +00:00
A state that becomes active when state machine is activated by [method set_active] method.
2022-11-01 20:31:22 +00:00
</member>
<member name="update_mode" type="int" setter="set_update_mode" getter="get_update_mode" enum="LimboHSM.UpdateMode" default="0">
2022-11-04 12:27:09 +00:00
Determines when state machine is updated. See [enum UpdateMode].
2022-11-01 20:31:22 +00:00
</member>
</members>
<signals>
<signal name="state_changed">
<argument index="0" name="p_state" type="LimboState" />
<description>
2022-11-04 12:27:09 +00:00
Emitted when state is changed.
2022-11-01 20:31:22 +00:00
</description>
</signal>
</signals>
<constants>
<constant name="IDLE" value="0" enum="UpdateMode">
2022-11-04 12:27:09 +00:00
Update state machine during idle process.
2022-11-01 20:31:22 +00:00
</constant>
<constant name="PHYSICS" value="1" enum="UpdateMode">
2022-11-04 12:27:09 +00:00
Update state machine during physics process.
2022-11-01 20:31:22 +00:00
</constant>
<constant name="MANUAL" value="2" enum="UpdateMode">
2022-11-04 12:27:09 +00:00
Update state machine manually by calling [method update] from a script.
2022-11-01 20:31:22 +00:00
</constant>
</constants>
</class>