package com.tiedup.remake.entities.kidnapper.hosts;

import com.tiedup.remake.dialogue.EntityDialogueManager;
import com.tiedup.remake.entities.EntityKidnapper;
import com.tiedup.remake.entities.damsel.components.DamselInventoryManager;
import com.tiedup.remake.entities.damsel.components.IBondageHost;
import com.tiedup.remake.personality.PersonalityState;
import java.util.UUID;
import net.minecraft.core.BlockPos;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;

/**
 * Host implementation for BondageManager callbacks specific to EntityKidnapper.
 *
 * its own IBondageHost instead of inheriting EntityDamsel's BondageHost.
 *
 * Key differences from the Damsel BondageHost:
 * - getPersonalityState() returns null (kidnappers have no personality system)
 * - talkToPlayersInRadius() is a no-op (kidnapper dialogue is separate)
 *
 * NOTE: This host is created during super() constructor (AbstractTiedUpNpc).
 * It must only store the entity reference, NOT access any EntityKidnapper fields
 * that haven't been initialized yet.
 */
public class BondageHost implements IBondageHost {

    private final EntityKidnapper entity;

    public BondageHost(EntityKidnapper entity) {
        this.entity = entity;
    }

    @Override
    public PersonalityState getPersonalityState() {
        // Kidnappers don't have a personality system
        return null;
    }

    @Override
    public DamselInventoryManager getInventory() {
        return entity.getInventoryManager();
    }

    @Override
    public void dropItemStack(ItemStack stack) {
        entity.spawnAtLocation(stack);
    }

    @Override
    public void playSound(SoundEvent sound) {
        entity.playSound(sound, 1.0f, 1.0f);
    }

    @Override
    public void setHealth(float health) {
        entity.setHealth(health);
    }

    @Override
    public void remove(Entity.RemovalReason reason) {
        entity.remove(reason);
    }

    @Override
    public Level level() {
        return entity.level();
    }

    @Override
    public BlockPos blockPosition() {
        return entity.blockPosition();
    }

    @Override
    public UUID getUUID() {
        return entity.getUUID();
    }

    @Override
    public String getNpcName() {
        return entity.getNpcName();
    }

    @Override
    public void talkToPlayersInRadius(
        EntityDialogueManager.DialogueCategory category,
        int radius
    ) {
        // Kidnappers use their own dialogue system (KidnapperDialogueTriggerSystem),
        // not the damsel dialogue categories. No-op here.
    }
}
