UNPKG

mistreevous

Version:

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

20 lines (19 loc) 818 B
import Callback from "./Callback"; import { Agent } from "../../Agent"; /** * An EXIT callback which defines an agent function to call when the associated node is updated and moves to a finished state or is aborted. */ export default class Exit extends Callback { /** * @param functionName The name of the agent function to call. * @param args The array of callback argument definitions. */ constructor(functionName: string, args: any[]); /** * Attempt to call the agent function that this callback refers to. * @param agent The agent. * @param isSuccess Whether the decorated node was left with a success state. * @param isAborted Whether the decorated node was aborted. */ callAgentFunction: (agent: Agent, isSuccess: boolean, isAborted: boolean) => void; }