Constructor
new BaseNode(params)
- Source:
Parameters:
| Name | Type | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object |
Properties
|
Members
category :NodeCategory
- Source:
Node category. Must be COMPOSITE, DECORATOR, TASK or
CONDITION. This is defined automatically be inheriting the
correspondent class.
Type:
description :string
- Source:
Node description.
Type:
- string
id :NodeId
- Source:
- See:
-
- RFC4122: https://tools.ietf.org/html/rfc4122
unique identifier of node. It uses the UUID format.
Type:
name :string
- Source:
Node name.
Type:
- string
(readonly) properties :Object
- Source:
A dictionary (key, value) describing the node properties. Useful for defining custom variables inside the visual editor.
Type:
- Object
type :string
- Source:
type of node. Must be a unique. e.g. class name
Type:
- string
Methods
_close(context) → {void}
- Source:
Wrapper for close method.
Parameters:
| Name | Type | Description |
|---|---|---|
context |
Context | A run instance. |
Returns:
- Type
- void
(protected) _enter(context)
- Source:
Wrapper for enter method.
Parameters:
| Name | Type | Description |
|---|---|---|
context |
Context | A run instance. |
(protected) _exit(context)
- Source:
Wrapper for exit method.
Parameters:
| Name | Type | Description |
|---|---|---|
context |
Context | A run instance. |
(protected) _open(context)
- Source:
Wrapper for open method.
Parameters:
| Name | Type | Description |
|---|---|---|
context |
Context | A run instance. |
(protected) _run(context) → {NodeStatus}
- Source:
Wrapper for run method.
Parameters:
| Name | Type | Description |
|---|---|---|
context |
Context | A run instance. |
Returns:
A state constant.
- Type
- NodeStatus
_tick(context) → {NodeStatus}
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
context |
Context | A run instance. |
Returns:
The run state.
- Type
- NodeStatus
close(context)
- Source:
Close method, override this to use. This method is called after the run
callback, and only if the run return a state different from
RUNNING.
Parameters:
| Name | Type | Description |
|---|---|---|
context |
Context | A run instance. |
enter(context)
- Source:
Enter method, override this to use. It is called every time a node is asked to run, before the run itself.
Parameters:
| Name | Type | Description |
|---|---|---|
context |
Context | A run instance. |
exit(context)
- Source:
Exit method, override this to use. Called every time in the end of the execution.
Parameters:
| Name | Type | Description |
|---|---|---|
context |
Context | A run instance. |
open(context)
- Source:
Open method, override this to use. It is called only before the run callback and only if the not isn't closed.
Note: a node will be closed if it returned RUNNING in the run.
Parameters:
| Name | Type | Description |
|---|---|---|
context |
Context | A run instance. |
run(context)
- Source:
Context method, override this to use. This method must contain the real execution of node (perform a task, call children, etc.). It is called every time a node is asked to run.
Parameters:
| Name | Type | Description |
|---|---|---|
context |
Context | A run instance. |
tick(context) → {NodeStatus}
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
context |
Context | A run instance. |
Returns:
The run state.
- Type
- NodeStatus