@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
80 lines • 2.28 kB
TypeScript
/**
* ECS wrapper around a {@link Behavior} tree
*/
export class BehaviorComponent {
/**
* Executes input function every update cycle.
* Will run forever, or until function throws.
* @param {function(time_delta_seconds:number)} action function to loop over
* @param {*} [thisArg]
* @returns {BehaviorComponent}
*/
static loop(action: any, thisArg?: any): BehaviorComponent;
/**
*
* @param {Behavior} b
* @returns {BehaviorComponent}
*/
static from(b: Behavior): BehaviorComponent;
/**
* What clock should be used for ticking associated behavior.
* Some behaviors need to run at world's simulated time, while others will need to be executed in real-world time.
* @type {ClockChannelType|number}
*/
clock: ClockChannelType | number;
/**
*
* @type {number}
*/
flags: number;
/**
* Associated behavior tree
* @type {Behavior|null}
* @private
*/
private __behavior;
/**
*
* @param {number|BehaviorComponentFlag} flag
* @returns {void}
*/
setFlag(flag: number | BehaviorComponentFlag): void;
/**
*
* @param {number|BehaviorComponentFlag} flag
* @returns {void}
*/
clearFlag(flag: number | BehaviorComponentFlag): void;
/**
*
* @param {number|BehaviorComponentFlag} flag
* @param {boolean} value
*/
writeFlag(flag: number | BehaviorComponentFlag, value: boolean): void;
/**
*
* @param {number|BehaviorComponentFlag} flag
* @returns {boolean}
*/
getFlag(flag: number | BehaviorComponentFlag): boolean;
/**
* Note that swapping behaviors during simulation may have unintended consequences
* @param {Behavior} v
*/
set behavior(v: Behavior);
/**
*
* @returns {Behavior|null}
*/
get behavior(): Behavior | null;
}
export namespace BehaviorComponent {
import fromOne = BehaviorComponent.from;
export { fromOne };
import looping_function = BehaviorComponent.loop;
export { looping_function };
export let serializable: boolean;
export let typeName: string;
}
import { ClockChannelType } from "./ClockChannelType.js";
//# sourceMappingURL=BehaviorComponent.d.ts.map