[trim] fully-unreachable files deleted: 3 [trim] files edited: 6, files deleted: 0, nodes removed: 23 [type-trim] files edited: 0, types removed: 0 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
48 lines
958 B
C#
48 lines
958 B
C#
using System.Collections.Generic;
|
|
|
|
namespace Wizard;
|
|
|
|
public class AIDeckData
|
|
{
|
|
private Dictionary<int, AICardData> cardDic;
|
|
|
|
public Dictionary<int, AICardData> CardDic => cardDic;
|
|
|
|
public AIDeckData()
|
|
{
|
|
cardDic = new Dictionary<int, AICardData>();
|
|
}
|
|
|
|
public bool RegisterCardData(AICardDataAsset asset, AICardData mergeData = null, bool isMergeDefaultParameter = false)
|
|
{
|
|
if (cardDic.ContainsKey(asset.CardID))
|
|
{
|
|
return false;
|
|
}
|
|
AICardData aICardData = new AICardData(asset);
|
|
if (mergeData != null)
|
|
{
|
|
if (isMergeDefaultParameter)
|
|
{
|
|
aICardData.MergeCardData(mergeData);
|
|
}
|
|
else
|
|
{
|
|
aICardData.MergeTagFromAnotherData(mergeData);
|
|
}
|
|
}
|
|
cardDic.Add(asset.CardID, aICardData);
|
|
return true;
|
|
}
|
|
|
|
public AICardData SearchCardData(int card_id)
|
|
{
|
|
AICardData value = null;
|
|
if (CardDic.TryGetValue(card_id, out value))
|
|
{
|
|
return value;
|
|
}
|
|
return null;
|
|
}
|
|
}
|