import { Behavior } from "../Behavior.js";
import { BehaviorStatus } from "../BehaviorStatus.js";

/**
 *
 * @author Alex Goldring
 * @copyright Company Named Limited (c) 2026
 */
export class FailingBehavior extends Behavior {

    /**
     *
     * @param [delayTicks] deprecated, do not use
     */
    constructor(delayTicks) {
        super();

        if (delayTicks !== undefined) {
            throw new Error(`parameters deprecated, use SequenceBehavior to delay the failure instead`)
        }

    }

    initialize(context) {
        this.onInitialized.send2(this, context);
    }

    tick(td) {
        return BehaviorStatus.Failed;
    }

    /**
     * @readonly
     * @type {FailingBehavior}
     */
    static INSTANCE = Object.freeze(new FailingBehavior());

}

FailingBehavior.typeName = "FailingBehavior";

