import { EntityEquippableComponent, EquipmentSlot } from "@minecraft/server";
export default class Entity_Equipment_Manager {
    static get(entity) {
        const equipment = {
            head: this.get_Slot(entity, EquipmentSlot.Head),
            chest: this.get_Slot(entity, EquipmentSlot.Chest),
            legs: this.get_Slot(entity, EquipmentSlot.Legs),
            feet: this.get_Slot(entity, EquipmentSlot.Feet),
            offhand: this.get_Slot(entity, EquipmentSlot.Offhand),
            mainhand: this.get_Slot(entity, EquipmentSlot.Mainhand),
        };
        return equipment;
    }
    static get_Slot(entity, slot) {
        return this.component(entity).getEquipment(slot);
    }
    static set(entity, equipment) {
        this.set_Slot(entity, EquipmentSlot.Head, equipment.head);
        this.set_Slot(entity, EquipmentSlot.Chest, equipment.chest);
        this.set_Slot(entity, EquipmentSlot.Legs, equipment.legs);
        this.set_Slot(entity, EquipmentSlot.Feet, equipment.feet);
        this.set_Slot(entity, EquipmentSlot.Offhand, equipment.offhand);
        this.set_Slot(entity, EquipmentSlot.Mainhand, equipment.mainhand);
    }
    static set_Slot(entity, slot, item) {
        return this.component(entity).setEquipment(slot, item);
    }
    static clear(entity) {
        this.set_Slot(entity, EquipmentSlot.Head);
        this.set_Slot(entity, EquipmentSlot.Chest);
        this.set_Slot(entity, EquipmentSlot.Legs);
        this.set_Slot(entity, EquipmentSlot.Feet);
        this.set_Slot(entity, EquipmentSlot.Offhand);
        this.set_Slot(entity, EquipmentSlot.Mainhand);
    }
    static component(entity) {
        return entity.getComponent(EntityEquippableComponent.componentId);
    }
}
