API Documentation for:
Show:

Condition

Extends BaseNode
Defined in: Condition:4
Module: b3

Condition is the base class for all condition nodes. Thus, if you want to create new custom condition nodes, you need to inherit from this class.

Methods

_close

(
  • tick
)
protected

Inherited from BaseNode: _close:166

Wrapper for close method.

Parameters:

  • tick Tick

    A tick instance.

_enter

(
  • tick
)
protected

Inherited from BaseNode: _enter:131

Wrapper for enter method.

Parameters:

  • tick Tick

    A tick instance.

_execute

(
  • tick
)
Constant protected

Inherited from BaseNode: _execute:96

This is the main method to propagate the tick signal to this node. This method calls all callbacks: enter, open, tick, close, and exit. It only opens a node if it is not already open. In the same way, this method only close a node if the node returned a status different of RUNNING.

Parameters:

  • tick Tick

    A tick instance.

Returns:

Constant:

The tick state.

_exit

(
  • tick
)
protected

Inherited from BaseNode: _exit:178

Wrapper for exit method.

Parameters:

  • tick Tick

    A tick instance.

_open

(
  • tick
)
protected

Inherited from BaseNode: _open:142

Wrapper for open method.

Parameters:

  • tick Tick

    A tick instance.

_tick

(
  • tick
)
Constant protected

Inherited from BaseNode: _tick:154

Wrapper for tick method.

Parameters:

  • tick Tick

    A tick instance.

Returns:

Constant:

A state constant.

BaseNode#category

()

Inherited from BaseNode: BaseNode#category:37

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

BaseNode#description

()

Node description.

BaseNode#name

()

Inherited from BaseNode: BaseNode#name:46

Node name. Must be a unique identifier, preferable the same name of the class. You have to set the node name in the prototype.

BaseNode#title

()

Inherited from BaseNode: BaseNode#title:55

Node title.

close

(
  • tick
)

Inherited from BaseNode: close:219

Close method, override this to use. This method is called after the tick callback, and only if the tick return a state different from RUNNING.

Parameters:

  • tick Tick

    A tick instance.

enter

(
  • tick
)

Inherited from BaseNode: enter:189

Enter method, override this to use. It is called every time a node is asked to execute, before the tick itself.

Parameters:

  • tick Tick

    A tick instance.

exit

(
  • tick
)

Inherited from BaseNode: exit:229

Exit method, override this to use. Called every time in the end of the execution.

Parameters:

  • tick Tick

    A tick instance.

initialize

()

Inherited from BaseNode: initialize:28

Initialization method.

open

(
  • tick
)

Inherited from BaseNode: open:198

Open method, override this to use. It is called only before the tick callback and only if the not isn't closed.

Note: a node will be closed if it returned RUNNING in the tick.

Parameters:

  • tick Tick

    A tick instance.

tick

(
  • tick
)

Inherited from BaseNode: tick:209

Tick 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 execute.

Parameters:

  • tick Tick

    A tick instance.

Properties

parameters

Object deprecated

Inherited from BaseNode: parameters:80

Deprecated: since 0.2.0.

A dictionary (key, value) describing the node parameters. Useful for defining parameter values in the visual editor. Note: this is only useful for nodes when loading trees from JSON files.

Deprecated since 0.2.0. This is too similar to the properties attribute, thus, this attribute is deprecated in favor to properties.

properties

Object

Inherited from BaseNode: properties:70

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