import { BranchTask } from "../base"; import { Task } from "../Task"; import { ParallelOrchestrator } from "./ParallelOrchestrator"; import { ParallelPolicy } from "./ParallelPolicy"; import { ParallelResult } from "./ParallelResult"; /** * A Parallel is a special branch task that runs all children when stepped. * * Its actual behavior depends on its orchestrator and policy. * * The execution of the parallel task's children depends on its orchestrator: * - Orchestrator.Resume: the parallel task restarts or runs each child every step. * - Orchestrator.Join: child tasks will run until success or failure but will not * re-run until the parallel task has succeeded or failed. * * The actual result of the parallel task depends on its policy: * - Policy.Sequence: the parallel task fails as soon as one child fails; if all * children succeed, then the parallel task succeeds. This is the default policy. * - Policy.Selector: the parallel task succeeds as soon as one child succeeds; * if all children fail, then the parallel task fails. * * The typical use case: make the game entity react on event while sleeping or wandering. */ export declare class Parallel extends BranchTask { orchestrator: ParallelOrchestrator; policy: ParallelPolicy; noRunningTasks: boolean; currentChildIndex: number; lastResult: ParallelResult; constructor(); run(): void; childSuccess(runningTask: Task): void; childFail(runningTask: Task): void; childRunning(runningTask: Task, reporter: Task): void; resetTask(): void; reset(): void; resetAllChildren(): void; }