package com.tiedup.remake.v2.furniture;

import com.tiedup.remake.v2.BodyRegionV2;
import java.util.List;
import java.util.Set;
import net.minecraft.world.entity.Entity;
import org.jetbrains.annotations.Nullable;

/**
 * Universal interface for entities that hold players in constrained poses.
 *
 * <p>Implemented by EntityFurniture (static) and optionally by monsters/NPCs.
 * All downstream systems (packets, animation, rendering) check ISeatProvider,
 * never EntityFurniture directly.</p>
 */
public interface ISeatProvider {
    /** All seat definitions for this entity. */
    List<SeatDefinition> getSeats();

    /** Which seat is this passenger in? Null if not seated. */
    @Nullable
    SeatDefinition getSeatForPassenger(Entity passenger);

    /** Assign a passenger to a specific seat. */
    void assignSeat(Entity passenger, String seatId);

    /** Release a passenger's seat assignment. */
    void releaseSeat(Entity passenger);

    /** Is this specific seat locked? */
    boolean isSeatLocked(String seatId);

    /** Lock/unlock a specific seat. */
    void setSeatLocked(String seatId, boolean locked);

    /** The locked difficulty for this seat. */
    int getLockedDifficulty(String seatId);

    /** Blocked body regions for a specific seat. */
    Set<BodyRegionV2> getBlockedRegions(String seatId);

    /** Whether items on non-blocked regions add to escape difficulty. */
    boolean hasItemDifficultyBonus(String seatId);

    /** Convenience: get the entity this interface is attached to. */
    default Entity asEntity() {
        return (Entity) this;
    }
}
