blueshell
Version:
A Behavior Tree implementation in modern Javascript
32 lines (31 loc) • 1.06 kB
TypeScript
import { Composite } from './Composite';
import { BlueshellState, ResultCode } from '../models';
/**
* Selector Node (a.k.a. Fallback)
* Sends an event to each child until one of them returns `SUCCESS` or `RUNNING`, then returns that value.
* If all children return `FAILURE`, then this node returns `FAILURE`.
* 1/18/16
* @author Joshua Chaitin-Pollak
*/
export declare class Selector<S extends BlueshellState, E> extends Composite<S, E> {
/**
* Recursively sends the event to each child until one of them returns
* success or running. If we exhaust all the children, return failure.
* @param state The state when the event occured.
* @param event The event to handle.
* @param i The child index.
*/
protected handleChild(state: S, event: E, i: number): ResultCode;
/**
* @ignore
* @param res
* @param state
* @param event
*/
protected _afterChild(res: ResultCode, state: S, event: E): {
res: ResultCode;
state: S;
event: E;
};
get symbol(): string;
}