UNPKG

mistreevous

Version:

A library to declaratively define, build and execute behaviour trees, written in TypeScript for Node and browsers

27 lines (26 loc) 835 B
import Composite from "./Composite"; import Node from "../Node"; import { Agent } from "../../Agent"; import Attribute from "../../attributes/Attribute"; import { BehaviourTreeOptions } from "../../BehaviourTreeOptions"; /** * A PARALLEL node. * The child nodes are executed concurrently until one fails or all succeed. */ export default class Parallel extends Composite { /** * @param attributes The node attributes. * @param options The behaviour tree options. * @param children The child nodes. */ constructor(attributes: Attribute[], options: BehaviourTreeOptions, children: Node[]); /** * Called when the node is being updated. * @param agent The agent. */ protected onUpdate(agent: Agent): void; /** * Gets the name of the node. */ getName: () => string; }