using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Vanguard.Api.Contracts;
using Vanguard.Shared.Protocol;
namespace Vanguard.UI.Overlays
{
///
/// Единый горизонтальный список карт для Deck/Drop/Soul/Damage/Trigger/Hand.
/// Порядок задаёт адаптер: первой идёт карта, лежащая сверху зоны.
///
public sealed class CardListView
{
private readonly RectTransform _root;
private readonly RectTransform _content;
private readonly Text _title;
private readonly Func _catalog;
private Action _onEntry;
private Action _onClose;
public CardListView(
Transform parent,
Func catalog)
{
_catalog = catalog;
var prefabRoot = OverlayPrefabs.Instantiate("CardListView", parent);
if (prefabRoot != null)
{
_root = prefabRoot;
_title = _root.Find("CardListPanel/Header/Title").GetComponent();
_content = (RectTransform)_root.Find(
"CardListPanel/CardScroll/Viewport/Content");
WireClose(_root.Find("CardListPanel/Header/Close").GetComponent