using System.Collections.Generic; namespace Wizard; public static class AIPlayPtnUtility { public static bool IsInPlayPtn(AIVirtualCard card, List 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 filters, AIVirtualCard tagOwner, List 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 filters, AIVirtualCard tagOwner, List playPtn, AISituationInfo situation) { if (playPtn == null || playPtn.Count <= 0) { return 0; } AIVirtualField selfField = tagOwner.SelfField; List list = new List(); for (int i = 0; i < playPtn.Count; i++) { list.Add(selfField.AllyHandCards[playPtn[i]]); } return AIFilteringUtility.MultipleFiltering(list, filters, tagOwner, playPtn, situation)?.Count ?? 0; } }