BaseComposite

BaseComposite

Class BaseComposite

Constructor

new BaseComposite(options)

Source:
Parameters:
Name Type Description
options object
Properties
Name Type Description
children Array.<BaseNode>
type string

Node type (class name)

name string
description string
properties object

Extends

Members

category :NodeCategory

Source:
Overrides:

Node category. Must be COMPOSITE, DECORATOR, TASK or CONDITION. This is defined automatically be inheriting the correspondent class.

Type:

description :string

Source:
Overrides:

Node description.

Type:
  • string

id :NodeId

Source:
Overrides:
See:
  • RFC4122: https://tools.ietf.org/html/rfc4122

unique identifier of node. It uses the UUID format.

Type:

name :string

Source:
Overrides:

Node name.

Type:
  • string

(readonly) properties :Object

Source:
Overrides:

A dictionary (key, value) describing the node properties. Useful for defining custom variables inside the visual editor.

Type:
  • Object

type :string

Source:
Overrides:

type of node. Must be a unique. e.g. class name

Type:
  • string

Methods

_close(context) → {void}

Source:
Overrides:

Wrapper for close method.

Parameters:
Name Type Description
context Context

A run instance.

Returns:
Type
void

(protected) _enter(context)

Source:
Overrides:

Wrapper for enter method.

Parameters:
Name Type Description
context Context

A run instance.

(protected) _exit(context)

Source:
Overrides:

Wrapper for exit method.

Parameters:
Name Type Description
context Context

A run instance.

(protected) _open(context)

Source:
Overrides:

Wrapper for open method.

Parameters:
Name Type Description
context Context

A run instance.

(protected) _run(context) → {NodeStatus}

Source:
Overrides:

Wrapper for run method.

Parameters:
Name Type Description
context Context

A run instance.

Returns:

A state constant.

Type
NodeStatus

_tick(context) → {NodeStatus}

Source:
Overrides:
Parameters:
Name Type Description
context Context

A run instance.

Returns:

The run state.

Type
NodeStatus

close(context)

Source:
Overrides:

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:
Overrides:

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:
Overrides:

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:
Overrides:

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:
Overrides:

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:
Overrides:
Parameters:
Name Type Description
context Context

A run instance.

Returns:

The run state.

Type
NodeStatus