UNPKG

blueshell

Version:

A Behavior Tree implementation in modern Javascript

31 lines (30 loc) 998 B
import { Composite } from './Composite'; import { BlueshellState, ResultCode } from '../models'; /** * Sends an event to each child until one of the returns `FAILURE`, or `RUNNING`, then returns that value. * If all children return `SUCCESS`, return `SUCCESS`. * 1/10/16 * @author Joshua Chaitin-Pollak */ export declare class Sequence<S extends BlueshellState, E> extends Composite<S, E> { /** * Recursively executes children until one of them returns * failure. If we call all the children successfully, return success. * @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; }