Files
SVSimServer/SVSim.BattleEngine/Engine/NetworkBattleSetupValidateEvent.cs
gamer147 0d9d8acae0 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.
2026-06-05 16:57:20 -04:00

71 lines
2.2 KiB
C#

using System.Collections.Generic;
public class NetworkBattleSetupValidateEvent
{
private NetworkBattleManagerBase _battleMgr;
private NetworkBattleSetupCardEvent _networkBattleSetupCardEvent;
public NetworkBattleSetupValidateEvent(NetworkBattleManagerBase battleMgr, NetworkBattleSetupCardEvent cardEvent)
{
_battleMgr = battleMgr;
_networkBattleSetupCardEvent = cardEvent;
}
public void SettingPlayerValidateEvent(SkillBase skillData)
{
if (_networkBattleSetupCardEvent.IsCheckValidateSkill(skillData))
{
skillData.OnSkillStart -= Event_SendValidateCard_MemorySkillIndex;
skillData.OnSkillStart += Event_SendValidateCard_MemorySkillIndex;
}
}
private void Event_SendValidateCard_MemorySkillIndex(SkillBase skillBase, IEnumerable<BattleCardBase> cards, SkillConditionCheckerOption option = null)
{
NetworkBattleManagerBase battleMgr = _battleMgr;
foreach (BattleCardBase card in cards)
{
battleMgr.AddValidateSkillIndexList(card.Index, card.IsPlayer, NetworkBattleGenericTool.GetSkillIndex(skillBase));
}
if (skillBase.SkillPrm.ownerCard.IsHaveBurialRiteJudgeBothFlag && battleMgr.IsValidateSkillIndexListEmpty)
{
battleMgr.AddValidateSkillIndexList(-1, isPlayer: true, NetworkBattleGenericTool.GetSkillIndex(skillBase));
}
}
public void OpponentPlayerIncludedValidateSkillToNotPlay(SkillBase skillData)
{
if (_networkBattleSetupCardEvent.IsCheckValidateSkill(skillData))
{
return;
}
bool flag = false;
int num = 0;
foreach (SkillBase skill in skillData.SkillPrm.ownerCard.Skills)
{
if (_networkBattleSetupCardEvent.IsCheckValidateSkill(skill) && !_battleMgr.GetValidateTargetSkillIndexList().Contains(num))
{
flag = true;
break;
}
num++;
}
if (!flag)
{
return;
}
foreach (SkillVariableComareFilter item in skillData.ConditionFilterCollection.VariableCompareFilter)
{
foreach (string item2 in (IEnumerable<string>)item.Text.Split('.'))
{
if (item2 == SkillFilterCreator.ContentKeyword.hand_other_self.ToString() || item2 == SkillFilterCreator.ContentKeyword.hand_other_oldest.ToString())
{
(skillData._executionInfoCreator as NetworkExecutionInfoCreator).SetNotPlaySkill();
break;
}
}
}
}
}