feat(battle-engine): M1 auto-copy closure (782 battle-logic files)
Compile-driven bulk-copy loop (tools/engine-port/m1_copy_loop.py) pulled the precise reference closure of the battle-core roots, stopping at the classify god-object/View-VFX-UI boundary. 782 files; no re-explosion (M0 had estimated ~order 1000). Residual frontier = 52 shim-classified + 80 external (Unity/BCL) types to author next.
This commit is contained in:
@@ -0,0 +1,124 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class AIVirtualFusionIngredientsInfo
|
||||
{
|
||||
public List<int> FusionTurnList { get; private set; }
|
||||
|
||||
public List<AIVirtualCard> CardList { get; private set; }
|
||||
|
||||
public int FusionCount
|
||||
{
|
||||
get
|
||||
{
|
||||
if (CardList != null)
|
||||
{
|
||||
return CardList.Count;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasFusionIngredients
|
||||
{
|
||||
get
|
||||
{
|
||||
if (CardList != null)
|
||||
{
|
||||
return CardList.Count > 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public AIVirtualFusionIngredientsInfo()
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
public void CopyFusionIngredientsFromBattleCard(List<FusionIngredientInfo> fusionIngredients, AIVirtualField field)
|
||||
{
|
||||
if (fusionIngredients != null && fusionIngredients.Count > 0)
|
||||
{
|
||||
if (CardList == null || FusionTurnList == null)
|
||||
{
|
||||
CardList = new List<AIVirtualCard>();
|
||||
FusionTurnList = new List<int>();
|
||||
}
|
||||
for (int i = 0; i < fusionIngredients.Count; i++)
|
||||
{
|
||||
FusionIngredientInfo fusionIngredientInfo = fusionIngredients[i];
|
||||
CardList.Add(new AIVirtualCard(fusionIngredientInfo.Card, field));
|
||||
FusionTurnList.Add(fusionIngredientInfo.FusionTurn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public AIVirtualFusionIngredientsInfo(AIVirtualFusionIngredientsInfo info)
|
||||
{
|
||||
if (info.HasFusionIngredients)
|
||||
{
|
||||
FusionTurnList = new List<int>(info.FusionTurnList);
|
||||
CardList = new List<AIVirtualCard>(info.CardList);
|
||||
}
|
||||
else
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
}
|
||||
|
||||
public void AddFusionIngredient(AIVirtualCard ingredient, int turn)
|
||||
{
|
||||
CardList = AIParamQuery.AddElementToList(ingredient, CardList);
|
||||
FusionTurnList = AIParamQuery.AddElementToList(turn, FusionTurnList);
|
||||
}
|
||||
|
||||
public bool Validate(AIVirtualFusionIngredientsInfo info)
|
||||
{
|
||||
if (FusionTurnList == null != (info.FusionTurnList == null) || CardList == null != (info.CardList == null))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (FusionTurnList != null && info.FusionTurnList != null)
|
||||
{
|
||||
if (FusionTurnList.Count != info.FusionTurnList.Count)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < FusionTurnList.Count; i++)
|
||||
{
|
||||
if (FusionTurnList[i] != info.FusionTurnList[i])
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CardList != null && info.CardList != null)
|
||||
{
|
||||
if (CardList.Count != info.CardList.Count)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
for (int j = 0; j < CardList.Count; j++)
|
||||
{
|
||||
if (!CardList[j].IsSameCard(info.CardList[j]))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public ulong GetHash()
|
||||
{
|
||||
return (ulong)(0 + (long)FusionCount * 55351L);
|
||||
}
|
||||
|
||||
private void Initialize()
|
||||
{
|
||||
FusionTurnList = null;
|
||||
CardList = null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user