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

import com.tiedup.remake.dialogue.EntityDialogueManager;
import com.tiedup.remake.entities.EntityDamsel;
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.
 * Extracted from EntityDamsel inner class for better organization.
 *
 */
public class BondageHost implements IBondageHost {

    private final EntityDamsel entity;

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

    @Override
    public PersonalityState getPersonalityState() {
        return entity.getPersonalitySystem() != null
            ? entity.getPersonalitySystem().getPersonalityState()
            : 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
    ) {
        entity.talkToPlayersInRadius(category, radius);
    }
}
