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.DamselAppearance;
import com.tiedup.remake.entities.damsel.components.DamselBondageManager;
import com.tiedup.remake.entities.damsel.components.DamselInventoryManager;
import com.tiedup.remake.entities.damsel.components.IPersonalityTickContext;
import com.tiedup.remake.v2.BodyRegionV2;
import java.util.UUID;
import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.Vec3;

/**
 * Host implementation for PersonalitySystem callbacks.
 * Extracted from EntityDamsel inner class for better organization.
 *
 */
public class PersonalityTickContextHost implements IPersonalityTickContext {

    private final EntityDamsel entity;

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

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

    @Override
    public int getTickCount() {
        return entity.tickCount;
    }

    @Override
    public boolean isLeashed() {
        return entity.isLeashed();
    }

    @Override
    public Vec3 getDeltaMovement() {
        return entity.getDeltaMovement();
    }

    @Override
    public boolean hasCollar() {
        return entity.getBondageManager().hasCollar();
    }

    @Override
    public ItemStack getEquipment(BodyRegionV2 region) {
        return entity.getBondageManager().getEquipment(region);
    }

    @Override
    public DamselBondageManager getBondageManager() {
        return entity.getBondageManager();
    }

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

    @Override
    public DamselAppearance getAppearance() {
        return entity.getAppearance();
    }

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

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

    @Override
    public void stopNavigation() {
        entity.getNavigation().stop();
    }

    @Override
    public Entity getLeashHolder() {
        return entity.getLeashHolder();
    }

    @Override
    public void talkToPlayersInRadius(
        EntityDialogueManager.DialogueCategory category,
        int radius
    ) {
        entity.talkToPlayersInRadius(category, radius);
    }

    @Override
    public void talkTo(Player player, String message) {
        entity.talkTo(player, message);
    }
}
