blueshell
Version:
A Behavior Tree implementation in modern Javascript
32 lines (31 loc) • 1.08 kB
TypeScript
import { BlueshellState, ResultCode, BaseNode } from '../../models';
import { Decorator } from '../Decorator';
/**
* Swaps one result from a child node for another.
* This can be used to mask `FAILURE`
*
* For example, you can use this to have a Sequene continue operation if a child returns `FAILURE`.
*
* 1/21/16
* @author Joshua Chaitin-Pollak
*/
export declare class ResultSwap<S extends BlueshellState, E> extends Decorator<S, E> {
private _inResult;
private _outResult;
/**
* @constructor
* @param _inResult The result to swap out (mask).
* @param _outResult The result to return when the child returns `_inResult'.
* @param child The child Node of the decorator.
* @param desc Optional description of the Node.
*/
constructor(_inResult: ResultCode, _outResult: ResultCode, child: BaseNode<S, E>, desc?: string);
/**
* Performs the swap from the child Node.
* @override
* @param state
* @param event
*/
protected decorateResult(res: ResultCode): ResultCode;
get symbol(): string;
}