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

/**
 * Makes the entity destroy itself
 *
 * @author Alex Goldring
 * @copyright Company Named Limited (c) 2026
 */
export class DieBehavior extends EntityBehavior {

    /**
     * Constructor alias
     * @return {DieBehavior}
     */
    static create() {
        return new DieBehavior();
    }

    tick(timeDelta) {

        const entity = this.entity;
        const ecd = this.ecd;

        ecd.removeEntity(entity);

        return BehaviorStatus.Succeeded;

    }
}

