UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

31 lines (23 loc) 803 B
import { Behavior } from "../Behavior.js"; import { BehaviorStatus } from "../BehaviorStatus.js"; /** * Behavior that always succeeds. * Useful when you need to specify a behavior to fulfill the API, but you don't actually want to perform any action. * You usually want to use {@link INSTANCE} singleton * @author Alex Goldring * @copyright Company Named Limited (c) 2025 */ export class SucceedingBehavior extends Behavior { initialize(context) { this.onInitialized.send2(this, context); } tick(timeDelta) { return BehaviorStatus.Succeeded; } /** * @readonly * @type {SucceedingBehavior} */ static INSTANCE = Object.freeze(new SucceedingBehavior()); } SucceedingBehavior.typeName = "SucceedingBehavior";