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

16 lines
700 B
JavaScript

/**
* @callback jibo.bt.decorators.Case~CaseConditional
* @returns {boolean} Return `true` to succeed the decorated behavior. `false` otherwise.
*/
/**
* @class Case
* @extends jibo.bt.Decorator
* @memberof jibo.bt.decorators
* @description
* Performs a single check before the behavior it's decorating starts. If that check fails, `Case` fails the
* behavior. Useful for decorating behaviors under a {@link jibo.bt.behaviors.Switch|Switch} behavior.
* @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options.
* @param {jibo.bt.decorators.Case~CaseConditional} options.conditional Function called every frame.
* Return `false` when you want component to fail.
*/