Fix various class documentation issues.

Fixes #10.
This commit is contained in:
Serhii Snitsaruk 2023-12-28 17:00:32 +01:00
parent 4cf5a18721
commit 7fc3831384
9 changed files with 25 additions and 25 deletions

View File

@ -4,7 +4,7 @@
Base class for all [BehaviorTree] actions. Base class for all [BehaviorTree] actions.
</brief_description> </brief_description>
<description> <description>
Base class for all actions within a [BehaviorTree]. You can create your own actions by extending the [code]BTAction[/code] class. Base class for all actions within a [BehaviorTree]. You can create your own actions by extending the [BTAction] class.
Represents a specific behavior or action in a [BehaviorTree] that an agent should execute. Actions are the lowest level of the [BehaviorTree] hierarchy and are responsible for performing the actual work required to achieve a goal. Actions do not have child tasks. Represents a specific behavior or action in a [BehaviorTree] that an agent should execute. Actions are the lowest level of the [BehaviorTree] hierarchy and are responsible for performing the actual work required to achieve a goal. Actions do not have child tasks.
A single action can perform a task within one or multiple ticks. If it takes more than one tick to complete the task, the action should return [code]RUNNING[/code] status. When the task is finished, the action returns either [code]SUCCESS[/code] or [code]FAILURE[/code] to indicate the outcome. A single action can perform a task within one or multiple ticks. If it takes more than one tick to complete the task, the action should return [code]RUNNING[/code] status. When the task is finished, the action returns either [code]SUCCESS[/code] or [code]FAILURE[/code] to indicate the outcome.
</description> </description>

View File

@ -4,16 +4,16 @@
BT condition that checks a trigger (a boolean variable). BT condition that checks a trigger (a boolean variable).
</brief_description> </brief_description>
<description> <description>
BTCheckTrigger verifies whether the [member variable] is set to [code]true[/code]. If it is, the task switches it to [code]false[/code] and returns [code]SUCCESS[/code]. Otherwise, it returns [code]FAILURE[/code]. [BTCheckTrigger] verifies whether the [member variable] is set to [code]true[/code]. If it is, the task switches it to [code]false[/code] and returns [code]SUCCESS[/code]. Otherwise, it returns [code]FAILURE[/code].
BTCheckTrigger can function as a "gate" within a [BTSequence]: when the trigger variable is set to [code]true[/code], it permits the execution of subsequent tasks and then changes the variable to [code]false[/code]. [BTCheckTrigger] can function as a "gate" within a [BTSequence]: when the trigger variable is set to [code]true[/code], it permits the execution of subsequent tasks and then changes the variable to [code]false[/code].
</description> </description>
<tutorials> <tutorials>
</tutorials> </tutorials>
<members> <members>
<member name="variable" type="String" setter="set_variable" getter="get_variable" default="&quot;&quot;"> <member name="variable" type="String" setter="set_variable" getter="get_variable" default="&quot;&quot;">
A boolean variable on the [member blackboard] used as a trigger. A boolean variable on the blackboard used as a trigger. See also [member BTTask.blackboard].
If variable's value is [code]true[/code], BTCheckTrigger will switch it to [code]false[/code] and return [code]SUCCESS[/code]. If variable's value is [code]true[/code], [BTCheckTrigger] will switch it to [code]false[/code] and return [code]SUCCESS[/code].
If variable's value is [code]false[/code], BTCheckTrigger will return [code]FAILURE[/code]. If variable's value is [code]false[/code], [BTCheckTrigger] will return [code]FAILURE[/code].
</member> </member>
</members> </members>
</class> </class>

View File

@ -4,7 +4,7 @@
Base class for BT conditions. Base class for BT conditions.
</brief_description> </brief_description>
<description> <description>
Base class for all [BehaviorTree] conditions. You can create your own conditions by extending the [code]BTCondition[/code] class. Base class for all [BehaviorTree] conditions. You can create your own conditions by extending the [BTCondition] class.
Condition is a task within a [BehaviorTree] that checks for a specific condition before executing subsequent tasks. It is often used inside composite tasks to control the execution flow. Conditions are used to verify the state of the environment, check for the presence of an enemy, or evaluate the health status of the agent. The use of condition tasks in a [BehaviorTree] can improve system efficiency and prevent unnecessary actions. However, they may not be suitable for complex decision-making processes, and too many condition tasks can make the [BehaviorTree] difficult to read. Condition is a task within a [BehaviorTree] that checks for a specific condition before executing subsequent tasks. It is often used inside composite tasks to control the execution flow. Conditions are used to verify the state of the environment, check for the presence of an enemy, or evaluate the health status of the agent. The use of condition tasks in a [BehaviorTree] can improve system efficiency and prevent unnecessary actions. However, they may not be suitable for complex decision-making processes, and too many condition tasks can make the [BehaviorTree] difficult to read.
Conditions typically don't take multiple ticks to finish and return either [code]SUCCESS[/code] or [code]FAILURE[/code] immediately. Conditions typically don't take multiple ticks to finish and return either [code]SUCCESS[/code] or [code]FAILURE[/code] immediately.
</description> </description>

View File

@ -55,14 +55,14 @@
<param index="0" name="p_status" type="int" /> <param index="0" name="p_status" type="int" />
<description> <description>
Emitted when the behavior tree has finished executing and returned [code]SUCCESS[/code] or [code]FAILURE[/code]. Emitted when the behavior tree has finished executing and returned [code]SUCCESS[/code] or [code]FAILURE[/code].
Argument [code]p_status[/code] holds the status returned by the behavior tree. See [enum BT.Status]. Argument [param p_status] holds the status returned by the behavior tree. See [enum BT.Status].
</description> </description>
</signal> </signal>
<signal name="updated"> <signal name="updated">
<param index="0" name="p_status" type="int" /> <param index="0" name="p_status" type="int" />
<description> <description>
Emitted when BTPlayer has finished the behavior tree update. Emitted when BTPlayer has finished the behavior tree update.
Argument [code]p_status[/code] holds the status returned by the behavior tree. See [enum BT.Status]. Argument [param p_status] holds the status returned by the behavior tree. See [enum BT.Status].
</description> </description>
</signal> </signal>
</signals> </signals>

View File

@ -4,7 +4,7 @@
BT action that waits for a randomized duration to elapse and then returns [code]SUCCESS[/code]. BT action that waits for a randomized duration to elapse and then returns [code]SUCCESS[/code].
</brief_description> </brief_description>
<description> <description>
BTRandomWait action waits for a randomized duration to elapse and then returns [code]SUCCESS[/code]. The duration is randomized within the specified range, defined by [code]min_duration[/code] and [code]max_duration[/code]. BTRandomWait action waits for a randomized duration to elapse and then returns [code]SUCCESS[/code]. The duration is randomized within the specified range, defined by [member min_duration] and [member max_duration].
</description> </description>
<tutorials> <tutorials>
</tutorials> </tutorials>

View File

@ -7,7 +7,7 @@
Base class for all [BehaviorTree] tasks. A task is a basic building block in a [BehaviorTree] that represents a specific behavior or control flow. Tasks are used to create complex behaviors by combining and nesting them in a hierarchy. Base class for all [BehaviorTree] tasks. A task is a basic building block in a [BehaviorTree] that represents a specific behavior or control flow. Tasks are used to create complex behaviors by combining and nesting them in a hierarchy.
A task can be one of the following types: action, condition, composite, or decorator. Each type of task has its own corresponding subclass: [BTAction], [BTCondition], [BTDecorator], [BTComposite]. A task can be one of the following types: action, condition, composite, or decorator. Each type of task has its own corresponding subclass: [BTAction], [BTCondition], [BTDecorator], [BTComposite].
Tasks perform their work and return their status using the [method _tick] method. Status values are defined in [enum BT.Status]. Tasks can be initialized using the [method _setup] method. See also [method _enter] &amp; [method _exit]. Tasks perform their work and return their status using the [method _tick] method. Status values are defined in [enum BT.Status]. Tasks can be initialized using the [method _setup] method. See also [method _enter] &amp; [method _exit].
[b]Note:[/b] Do not extend [code]BTTask[/code] directly for your own tasks. Instead, extend one of the subtypes mentioned above. [b]Note:[/b] Do not extend [BTTask] directly for your own tasks. Instead, extend one of the subtypes mentioned above.
</description> </description>
<tutorials> <tutorials>
</tutorials> </tutorials>
@ -62,7 +62,7 @@
<return type="void" /> <return type="void" />
<param index="0" name="p_child" type="BTTask" /> <param index="0" name="p_child" type="BTTask" />
<description> <description>
Adds a child task. The [code]p_child[/code] is placed at the end of the children list. Adds a child task. The [param p_child] is placed at the end of the children list.
</description> </description>
</method> </method>
<method name="add_child_at_index"> <method name="add_child_at_index">
@ -70,7 +70,7 @@
<param index="0" name="p_child" type="BTTask" /> <param index="0" name="p_child" type="BTTask" />
<param index="1" name="p_idx" type="int" /> <param index="1" name="p_idx" type="int" />
<description> <description>
Adds a child task. The [code]p_child[/code] is placed at [code]p_idx[/code] position in the children list. Adds a child task. The [param p_child] is placed at [param p_idx] position in the children list.
</description> </description>
</method> </method>
<method name="clone" qualifiers="const"> <method name="clone" qualifiers="const">
@ -137,7 +137,7 @@
<return type="bool" /> <return type="bool" />
<param index="0" name="p_child" type="BTTask" /> <param index="0" name="p_child" type="BTTask" />
<description> <description>
Returns [code]true[/code] if [code]p_child[/code] is a child of this task. Returns [code]true[/code] if [param p_child] is a child of this task.
</description> </description>
</method> </method>
<method name="initialize"> <method name="initialize">
@ -153,7 +153,7 @@
<return type="bool" /> <return type="bool" />
<param index="0" name="p_task" type="BTTask" /> <param index="0" name="p_task" type="BTTask" />
<description> <description>
Returns [code]true[/code] if this task is a descendant of [code]p_task[/code]. In other words, this task must be a child of [code]p_task[/code] or one of its children or grandchildren. Returns [code]true[/code] if this task is a descendant of [param p_task]. In other words, this task must be a child of [param p_task] or one of its children or grandchildren.
</description> </description>
</method> </method>
<method name="is_root" qualifiers="const"> <method name="is_root" qualifiers="const">
@ -180,7 +180,7 @@
<return type="void" /> <return type="void" />
<param index="0" name="p_child" type="BTTask" /> <param index="0" name="p_child" type="BTTask" />
<description> <description>
Removes [code]p_child[/code] task from children. Removes [param p_child] task from children.
</description> </description>
</method> </method>
<method name="remove_child_at_index"> <method name="remove_child_at_index">
@ -200,7 +200,7 @@
See [Blackboard] for additional info. See [Blackboard] for additional info.
</member> </member>
<member name="custom_name" type="String" setter="set_custom_name" getter="get_custom_name" default="&quot;&quot;"> <member name="custom_name" type="String" setter="set_custom_name" getter="get_custom_name" default="&quot;&quot;">
User-provided name for the task. If not empty, [code]custom_name[/code] is used by the editor to represent the task. See [method get_task_name]. User-provided name for the task. If not empty, it is used by the editor to represent the task. See [method get_task_name].
</member> </member>
<member name="elapsed_time" type="float" setter="" getter="get_elapsed_time"> <member name="elapsed_time" type="float" setter="" getter="get_elapsed_time">
Elapsed time since the task was "entered". See [method _enter]. Elapsed time since the task was "entered". See [method _enter].

View File

@ -42,7 +42,7 @@
<return type="bool" /> <return type="bool" />
<param index="0" name="p_key" type="Variant" /> <param index="0" name="p_key" type="Variant" />
<description> <description>
Returns [code]true[/code] if the Blackboard contains the [code]p_key[/code] variable, including the parent scopes. Returns [code]true[/code] if the Blackboard contains the [param p_key] variable, including the parent scopes.
</description> </description>
</method> </method>
<method name="prefetch_nodepath_vars"> <method name="prefetch_nodepath_vars">

View File

@ -15,7 +15,7 @@
<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>
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. Establishes a transition from one state to another when [param p_event] is dispatched. Both [param p_from_state] and [param p_to_state] 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">
@ -35,7 +35,7 @@
<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>
Initiates the state and calls [code]_setup[/code] for both itself and all substates. Initiates the state and calls [method LimboState._setup] for both itself and all substates.
</description> </description>
</method> </method>
<method name="set_active"> <method name="set_active">

View File

@ -41,28 +41,28 @@
<param index="0" name="p_event" type="String" /> <param index="0" name="p_event" type="String" />
<param index="1" name="p_handler" type="Callable" /> <param index="1" name="p_handler" type="Callable" />
<description> <description>
Registers a [code]p_method[/code] to be called when [code]p_event[/code] is dispatched. The method must belong to the state. Registers a [param p_handler] to be called when [param p_event] is dispatched. The method must belong to the state.
</description> </description>
</method> </method>
<method name="call_on_enter"> <method name="call_on_enter">
<return type="LimboState" /> <return type="LimboState" />
<param index="0" name="p_callable" type="Callable" /> <param index="0" name="p_callable" type="Callable" />
<description> <description>
A chained method that connects the [signal entered] signal to a [code]p_callable[/code]. A chained method that connects the [signal entered] signal to a [param p_callable].
</description> </description>
</method> </method>
<method name="call_on_exit"> <method name="call_on_exit">
<return type="LimboState" /> <return type="LimboState" />
<param index="0" name="p_callable" type="Callable" /> <param index="0" name="p_callable" type="Callable" />
<description> <description>
A chained method that connects the [signal exited] signal to a [code]p_callable[/code]. A chained method that connects the [signal exited] signal to a [param p_callable].
</description> </description>
</method> </method>
<method name="call_on_update"> <method name="call_on_update">
<return type="LimboState" /> <return type="LimboState" />
<param index="0" name="p_callable" type="Callable" /> <param index="0" name="p_callable" type="Callable" />
<description> <description>
A chained method that connects the [signal updated] signal to a [code]p_callable[/code]. A chained method that connects the [signal updated] signal to a [param p_callable].
</description> </description>
</method> </method>
<method name="clear_guard"> <method name="clear_guard">
@ -76,7 +76,7 @@
<param index="0" name="p_event" type="String" /> <param index="0" name="p_event" type="String" />
<param index="1" name="p_cargo" type="Variant" default="null" /> <param index="1" name="p_cargo" type="Variant" default="null" />
<description> <description>
Recursively dispatches a state machine event named [code]p_event[/code] with an optional argument [code]p_cargo[/code]. Returns [code]true[/code] if the event was consumed. Recursively dispatches a state machine event named [param p_event] with an optional argument [param p_cargo]. Returns [code]true[/code] if the event was consumed.
Events propagate from the leaf state to the root state, and propagation stops as soon as any state consumes the event. States will consume the event if they have a related transition or event handler. For more information on event handlers, see [method add_event_handler]. Events propagate from the leaf state to the root state, and propagation stops as soon as any state consumes the event. States will consume the event if they have a related transition or event handler. For more information on event handlers, see [method add_event_handler].
</description> </description>
</method> </method>