Authored Unity primitive/object-model shim, VFX layer (control-flow-preserving, InstantVfx never invokes its action -- headless suppression), god-object stubs (GameMgr/EffectMgr/UIManager with faithfully-extracted nested enums), View/UI/Touch tree, LitJson+BetterList+Tuple copied, third-party stubs. Discovered Roslyn header-error masking: fixing class-header type errors unmasks body references, so the true copy closure is ~2570 files (was 782 under masking). Errors: masked-25720 -> 268; our shim files compile clean. Remaining: ~50 residual shim/external types, 24 NGUI UI-base overrides, static-type fixes, plus likely 1-2 more unmask waves.
58 lines
1.5 KiB
C#
58 lines
1.5 KiB
C#
using System.Collections.Generic;
|
|
|
|
namespace Wizard;
|
|
|
|
public static class AIPlayPtnUtility
|
|
{
|
|
public static bool IsInPlayPtn(AIVirtualCard card, List<int> playPtn)
|
|
{
|
|
AIVirtualField selfField = card.SelfField;
|
|
for (int i = 0; i < playPtn.Count; i++)
|
|
{
|
|
if (selfField.AllyHandCards[playPtn[i]].IsSameCard(card))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public static int GetBeforePlayPtnCount(List<AIScriptTokenBase> filters, AIVirtualCard tagOwner, List<int> playPtn, AISituationInfo situation)
|
|
{
|
|
if (playPtn == null || playPtn.Count <= 0)
|
|
{
|
|
return 0;
|
|
}
|
|
int num = -1;
|
|
AIVirtualField selfField = tagOwner.SelfField;
|
|
for (int i = 0; i < playPtn.Count; i++)
|
|
{
|
|
if (selfField.AllyHandCards[playPtn[i]].IsSameCard(tagOwner))
|
|
{
|
|
num = i;
|
|
break;
|
|
}
|
|
}
|
|
if (num == -1)
|
|
{
|
|
return 0;
|
|
}
|
|
return GetPlayPtnCardCount(filters, tagOwner, playPtn.GetRange(0, num), situation);
|
|
}
|
|
|
|
public static int GetPlayPtnCardCount(List<AIScriptTokenBase> filters, AIVirtualCard tagOwner, List<int> playPtn, AISituationInfo situation)
|
|
{
|
|
if (playPtn == null || playPtn.Count <= 0)
|
|
{
|
|
return 0;
|
|
}
|
|
AIVirtualField selfField = tagOwner.SelfField;
|
|
List<AIVirtualCard> list = new List<AIVirtualCard>();
|
|
for (int i = 0; i < playPtn.Count; i++)
|
|
{
|
|
list.Add(selfField.AllyHandCards[playPtn[i]]);
|
|
}
|
|
return AIFilteringUtility.MultipleFiltering(list, filters, tagOwner, playPtn, situation)?.Count ?? 0;
|
|
}
|
|
}
|