feat(battle-engine): close the AI-simulation subsystem (verbatim)
Copied the 89 uncopied AI*SimulationUtility/extension files defining the AIVirtualCard/AIVirtualField extension methods; the compile loop then auto-closed the revealed type deps (~3049 files total, drift-clean). 10.0k -> 62 errors.
This commit is contained in:
41
SVSim.BattleEngine/Engine/Wizard/AICrystalizeUtility.cs
Normal file
41
SVSim.BattleEngine/Engine/Wizard/AICrystalizeUtility.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public static class AICrystalizeUtility
|
||||
{
|
||||
public static bool IsCrystalize(AIVirtualCard card, AIVirtualField field, List<int> playPtn, AISituationInfo situation)
|
||||
{
|
||||
if (card == null || card.CrystalizeCostList == null || !card.IsInHand)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
AIVariableResultContainer valResultContainer = field.AI.ValResultContainer;
|
||||
ulong hash = AIFunctionResultHashCalculator.GetHash(card, field, playPtn, null, 0uL);
|
||||
if (valResultContainer.GetContainsResultValue(AIScriptTokenVariableType.IS_CRYSTALIZE, hash, out var getResult))
|
||||
{
|
||||
return getResult == 1f;
|
||||
}
|
||||
List<int> playPtn2 = (card.IsAlly ? playPtn : null);
|
||||
bool flag = field.AI.PlayPtnRecorder.IsCardPlayingSimulationType(card, field, playPtn2, situation, PlaySimulationType.Crystalize);
|
||||
valResultContainer.CheckDuplicateAndAddRecord(AIScriptTokenVariableType.IS_CRYSTALIZE, hash, flag ? 1f : 0f, $"IsCrystalize(): Already hashed target and not equal value. CardName:[{card.CardName}] hash:[{hash}]");
|
||||
return flag;
|
||||
}
|
||||
|
||||
public static int GetCrystalizeId(AIVirtualCard card, int usedCost)
|
||||
{
|
||||
if (card.CrystalizeCostList == null || card.CrystalizeCostList.Count <= 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
for (int i = 0; i < card.CrystalizeCostList.Count; i++)
|
||||
{
|
||||
AICrystalizeInformation aICrystalizeInformation = card.CrystalizeCostList[i];
|
||||
if (aICrystalizeInformation.Cost == usedCost)
|
||||
{
|
||||
return aICrystalizeInformation.CardId;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user