forked from Jibo-Revival-Group/JiboOs
18 lines
791 B
JavaScript
18 lines
791 B
JavaScript
/**
|
|
* @callback jibo.bt.decorators.FailOnCondition~FailOnConditionConditional
|
|
* @extends jibo.bt.Behavior
|
|
* @returns {boolean} `true` when you want component to Fail.
|
|
*/
|
|
|
|
/**
|
|
* @class FailOnCondition
|
|
* @extends jibo.bt.Decorator
|
|
* @memberof jibo.bt.decorators
|
|
* @description Explicitly interrupts the behavior it's decorating and returns Status.FAILED if the
|
|
* conditional evaluates to `true`.
|
|
* @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options.
|
|
* @param {Function} [options.init] Function called at the start of this behavior. Used to initialize any
|
|
* variables or data.
|
|
* @param {jibo.bt.decorators.FailOnCondition~FailOnConditionConditional} options.conditional Function called every frame. Return `true`
|
|
* when you want component to fail.
|
|
*/ |