using System; using System.Collections.Generic; using System.Threading.Tasks; using Continentis.MainGame.Card; using SoulliesFramework.General; using UnityEngine; namespace Continentis { public class CardDatabase : Singleton { public Dictionary cardDatabase; protected override void Awake() { Initialize(true); } public async Task> CollectAllCardData() { IList dataList = await AssetLoader.LoadAssetsWithLabelAsync("CardData"); cardDatabase = new Dictionary(); foreach (CardData data in dataList) { if (!cardDatabase.TryAdd(data.cardIdentifier, data)) { Debug.LogWarning($"CardDatabase: Duplicate card ID found: {data.cardIdentifier}"); } } Debug.Log($"CardDatabase: Collected {cardDatabase.Count} cards."); return dataList; } } }