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

import com.tiedup.remake.entities.EntityDamsel;
import com.tiedup.remake.entities.damsel.components.IDialogueHost;
import java.util.List;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.AABB;

/**
 * Host implementation for DialogueHandler callbacks.
 * Extracted from EntityDamsel inner class for better organization.
 *
 */
public class DialogueHost implements IDialogueHost {

    private final EntityDamsel entity;

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

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

    @Override
    public AABB getBoundingBox() {
        return entity.getBoundingBox();
    }

    @Override
    public EntityDamsel getEntity() {
        return entity;
    }

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

    @Override
    public List<Player> findNearbyPlayers(double radius) {
        return entity
            .level()
            .getEntitiesOfClass(
                Player.class,
                entity.getBoundingBox().inflate(radius)
            );
    }
}
