[trim] fully-unreachable files deleted: 3 [trim] files edited: 21, files deleted: 0, nodes removed: 38 [type-trim] files edited: 3, types removed: 3 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
146 lines
3.7 KiB
C#
146 lines
3.7 KiB
C#
using System.Collections.Generic;
|
|
|
|
namespace Wizard;
|
|
|
|
public class AIDataLibrary
|
|
{
|
|
private readonly AIDeckData _basicDic;
|
|
|
|
private readonly AIDeckData _commonDic;
|
|
|
|
private readonly AIDeckData _allyCommonDic;
|
|
|
|
private readonly Dictionary<string, AIDeckData> _deckDic;
|
|
|
|
private readonly AIStyleData _commonStyle;
|
|
|
|
private readonly Dictionary<string, AIStyleData> _deckStyleDic;
|
|
|
|
private AISetUpData setupInfoBuf;
|
|
|
|
private readonly Dictionary<string, AIEmoteSet> emoteDic;
|
|
|
|
public AISetUpData SetupInfoBuf => setupInfoBuf;
|
|
|
|
public AIDataLibrary()
|
|
{
|
|
_basicDic = new AIDeckData();
|
|
_commonDic = new AIDeckData();
|
|
_allyCommonDic = new AIDeckData();
|
|
_commonStyle = new AIStyleData();
|
|
_deckStyleDic = new Dictionary<string, AIStyleData>();
|
|
_deckDic = new Dictionary<string, AIDeckData>();
|
|
emoteDic = new Dictionary<string, AIEmoteSet>();
|
|
}
|
|
|
|
public void SaveBattleSetUpInfo(int classID, AI_LOGIC_LV logicLv, string deckName, string styleName, string emoteName, bool useEmote, bool useInnerEmote, int enemyAiID, List<int> specialAbilityList)
|
|
{
|
|
setupInfoBuf = new AISetUpData(classID, logicLv, deckName, styleName, emoteName, useEmote, useInnerEmote, enemyAiID, specialAbilityList);
|
|
}
|
|
|
|
public void RegisterBasicData(AICardDataAsset asset)
|
|
{
|
|
_basicDic.RegisterCardData(asset);
|
|
}
|
|
|
|
public bool RegisterCommonData(AICardDataAsset asset)
|
|
{
|
|
AICardData mergeData = _basicDic.SearchCardData(asset.CardID);
|
|
return _commonDic.RegisterCardData(asset, mergeData);
|
|
}
|
|
|
|
public bool RegisterAllyCommonData(AICardDataAsset asset)
|
|
{
|
|
AICardData mergeData = _basicDic.SearchCardData(asset.CardID);
|
|
return _allyCommonDic.RegisterCardData(asset, mergeData);
|
|
}
|
|
|
|
public void RegisterDeckToDeckDic(string deckName, List<AICardDataAsset> cardDataAssetList)
|
|
{
|
|
AIDeckData aIDeckData = new AIDeckData();
|
|
for (int i = 0; i < cardDataAssetList.Count; i++)
|
|
{
|
|
AICardDataAsset aICardDataAsset = cardDataAssetList[i];
|
|
int cardID = aICardDataAsset.CardID;
|
|
bool useCommon = aICardDataAsset.UseCommon;
|
|
AICardData mergeData = ((!useCommon) ? _basicDic.SearchCardData(cardID) : _allyCommonDic.SearchCardData(cardID));
|
|
aIDeckData.RegisterCardData(aICardDataAsset, mergeData, useCommon);
|
|
}
|
|
RegisterDeck(deckName, aIDeckData);
|
|
}
|
|
|
|
public bool RegisterDeck(string deckName, AIDeckData deck)
|
|
{
|
|
if (_deckDic.ContainsKey(deckName))
|
|
{
|
|
return false;
|
|
}
|
|
_deckDic.Add(deckName, deck);
|
|
return true;
|
|
}
|
|
|
|
public bool RegisterEmoteSet(string emoteSetName, AIEmoteSet emoteSet)
|
|
{
|
|
if (emoteDic.ContainsKey(emoteSetName))
|
|
{
|
|
return false;
|
|
}
|
|
emoteDic.Add(emoteSetName, emoteSet);
|
|
return true;
|
|
}
|
|
|
|
public AIDeckData SearchDeckData(string name)
|
|
{
|
|
if (!_deckDic.ContainsKey(name))
|
|
{
|
|
return null;
|
|
}
|
|
return _deckDic[name];
|
|
}
|
|
|
|
public AIStyleData SearchDeckStyle(string name)
|
|
{
|
|
if (!_deckStyleDic.ContainsKey(name))
|
|
{
|
|
return null;
|
|
}
|
|
return _deckStyleDic[name];
|
|
}
|
|
|
|
public AIEmoteSet SearchEmoteSet(string name)
|
|
{
|
|
if (!emoteDic.ContainsKey(name))
|
|
{
|
|
return null;
|
|
}
|
|
return emoteDic[name];
|
|
}
|
|
|
|
public AIDeckData GetCommonDic()
|
|
{
|
|
return _commonDic;
|
|
}
|
|
|
|
public AIDeckData GetAllyCommonDic()
|
|
{
|
|
return _allyCommonDic;
|
|
}
|
|
|
|
public void RegisterCommonStyle(List<AIPolicyDataAsset> assetList)
|
|
{
|
|
_commonStyle.CreateFromAsset(assetList);
|
|
}
|
|
|
|
public bool RegisterDeckStyle(string styleName, List<AIPolicyDataAsset> assetList)
|
|
{
|
|
if (_deckStyleDic.ContainsKey(styleName))
|
|
{
|
|
return false;
|
|
}
|
|
AIStyleData aIStyleData = new AIStyleData();
|
|
aIStyleData.CreateFromAsset(assetList);
|
|
_deckStyleDic.Add(styleName, aIStyleData);
|
|
return true;
|
|
}
|
|
}
|