Files
JiboOs/docs/bt/behaviors/SubtreeJs.js
2026-03-16 13:53:01 +02:00

14 lines
993 B
JavaScript

/**
* @class SubtreeJs
* @extends jibo.bt.Behavior
* @memberof jibo.bt.behaviors
* @description Encapsulates an external subtree file (`.bt` file) into a single behavior. This behavior fails if the
* `.bt` tree fails and succeeds if that tree succeeds.
* @param {Object} options See {@link jibo.bt.Behavior|Behavior} for all options.
* @param {Function} options.getFileName Returns the path to the `.bt` file this behavior encapsulates. This assumes the root
* of all `.bt` files is in `${project}/behaviors`.
* @param {Function} options.getNotepad Returns an object that will become this referenced tree's notepad. Think of this as the
* arguments to this subtree.
* @param {Function} options.onResult Called when the external tree either fails or succeeds. A result object is passed as an argument.
* This result object is populated by the external tree. Think of this as the return value.
*/