package com.tiedup.remake.entities.kidnapper;

import com.tiedup.remake.entities.EntityDamsel;
import com.tiedup.remake.entities.EntityDamselShiny;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;

/**
 * Priority levels for captives when replacing prisoners in cells.
 * Higher priority captives will cause lower priority prisoners to be released.
 */
public enum CaptivePriority {
    DAMSEL(1),
    DAMSEL_SHINY(2),
    PLAYER(3);

    private final int priority;

    CaptivePriority(int priority) {
        this.priority = priority;
    }

    public int getPriority() {
        return priority;
    }

    /**
     * Get the priority for an entity.
     *
     * @param entity The entity to check
     * @return The captive priority
     */
    public static CaptivePriority fromEntity(LivingEntity entity) {
        if (entity instanceof Player) return PLAYER;
        if (entity instanceof EntityDamselShiny) return DAMSEL_SHINY;
        if (entity instanceof EntityDamsel) return DAMSEL;
        return DAMSEL; // Default for unknown entities
    }

    /**
     * Check if this priority is higher than another.
     */
    public boolean isHigherThan(CaptivePriority other) {
        return this.priority > other.priority;
    }
}
