UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

29 lines 1.02 kB
/** * Single-shot behavior that executes the given function and resolves {@link BehaviorStatus.SUCCESS} * @template CTX * @extends {Behavior<CTX>} * @example * // will print 'Hello World' in console when executed * ActionBehavior.from( () => console.log('Hello World') ); * @author Alex Goldring * @copyright Company Named Limited (c) 2025 */ export class ActionBehavior<CTX> extends Behavior<CTX> { /** * Constructor alias * @returns {ActionBehavior} */ static from(func: any, thisArg: any): ActionBehavior<any>; /** * * @param {function(timeDelta:number, context:CTX)} action * @param {*} [thisArg=this] defaults to behavior itself if not specified */ constructor(action: any, thisArg?: any); __action: any; __context: any; tick(timeDelta: any): BehaviorStatus.Succeeded | BehaviorStatus.Failed; } import { Behavior } from "../Behavior.js"; import { BehaviorStatus } from "../BehaviorStatus.js"; //# sourceMappingURL=ActionBehavior.d.ts.map