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

import com.tiedup.remake.v2.BodyRegionV2;
import java.util.UUID;
import net.minecraft.core.BlockPos;
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;

/**
 * Interface for EntityDamsel to provide callbacks to DamselPersonalitySystem.
 * This prevents circular dependencies while allowing the personality component
 * to access necessary host entity functionality.
 *
 */
public interface IPersonalityTickContext {
    /**
     * Get the level this entity is in.
     * @return level instance
     */
    Level level();

    /**
     * Get the current tick count for this entity.
     * @return tick count
     */
    int getTickCount();

    /**
     * Check if this entity is currently leashed.
     * @return true if leashed
     */
    boolean isLeashed();

    /**
     * Get the entity's current movement delta.
     * @return movement vector
     */
    Vec3 getDeltaMovement();

    /**
     * Check if this entity has a collar equipped.
     * @return true if collar present
     */
    boolean hasCollar();

    /**
     * Get the item equipped in a V2 body region.
     * @param region The body region to query
     * @return The equipped ItemStack, or empty if not present
     */
    ItemStack getEquipment(BodyRegionV2 region);

    /**
     * Get the bondage manager for checking bondage state.
     * @return bondage manager instance
     */
    DamselBondageManager getBondageManager();

    /**
     * Get the inventory manager for feeding logic.
     * @return inventory manager instance
     */
    DamselInventoryManager getInventoryManager();

    /**
     * Get the appearance manager for name access.
     * @return appearance instance
     */
    DamselAppearance getAppearance();

    /**
     * Get the entity's UUID.
     * @return entity UUID
     */
    UUID getUUID();

    /**
     * Get the block position of this entity.
     * @return block position
     */
    BlockPos blockPosition();

    /**
     * Stop the entity's navigation.
     */
    void stopNavigation();

    /**
     * Get the entity's leash holder entity.
     * @return leash holder, or null if not leashed
     */
    net.minecraft.world.entity.Entity getLeashHolder();

    /**
     * Talk to nearby players with a dialogue message.
     * @param category dialogue category
     * @param radius search radius
     */
    void talkToPlayersInRadius(
        com.tiedup.remake.dialogue.EntityDialogueManager.DialogueCategory category,
        int radius
    );

    /**
     * Talk directly to a specific player.
     * @param player target player
     * @param message message text
     */
    void talkTo(Player player, String message);
}
