using AppleHills.Data.CardSystem;
using UI.DragAndDrop.Core;
using UnityEngine;
namespace UI.CardSystem
{
///
/// Specialized slot for album pages that only accepts a specific card.
/// Validates cards based on their CardDefinition.
///
public class AlbumCardSlot : DraggableSlot
{
[Header("Album Slot Configuration")]
[SerializeField] private CardDefinition targetCardDefinition; // Which card this slot accepts
private bool _isOccupiedPermanently = false;
///
/// Set the target card this slot should accept
///
public void SetTargetCard(CardDefinition definition)
{
targetCardDefinition = definition;
}
///
/// Check if this slot can accept a specific card
///
public bool CanAcceptCard(CardData cardData)
{
if (cardData == null || targetCardDefinition == null) return false;
if (_isOccupiedPermanently) return false;
// Card must match this slot's target definition
return cardData.DefinitionId == targetCardDefinition.Id;
}
///
/// Called when a card is successfully placed in this slot
///
public void OnCardPlaced()
{
_isOccupiedPermanently = true;
}
///
/// Check if this slot has been permanently filled
///
public bool IsOccupiedPermanently => _isOccupiedPermanently;
///
/// Get the target card definition for this slot
///
public CardDefinition TargetCardDefinition => targetCardDefinition;
}
}