import * as utils from "../../utils/index";
/**
 * @remarks The base class for all components. This class **should not** be extended directly,
 * instead "category" base classes should be created to be used with difent types of NPCs
 */
export class ComponentBase {
    constructor() {
        this.id = this.constructor.name;
        this.dependencies = [];
    }
    async onComponentAdded(npc) {
        this.npc = npc;
        this.dependencies.forEach(dependency => {
            if (!npc.getComponent(dependency)) {
                utils.mcerror(`${this.id} Depends On Component (${dependency.ComponentId}) Not Present On ${npc.TypeId} (${npc.ID})`);
            }
        });
    }
    async onComponentRemoved(npc) { }
}
/**
 * @remarks The base class to be used by most components. This class should be extended to create unique components.
 */
export class ComponentNPC extends ComponentBase {
}
/**
 * @remarks The base class to be used by components that should work for {@link Companion} NPCs and their children. This class should be extended to create unique components.
 */
export class ComponentCompanion extends ComponentNPC {
}
