feat(battle-engine): full Unity/VFX/god-object shims + expanded copy closure (2570 files)
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.
This commit is contained in:
57
SVSim.BattleEngine/Engine/NetworkSkill_random_array.cs
Normal file
57
SVSim.BattleEngine/Engine/NetworkSkill_random_array.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
public class NetworkSkill_random_array : Skill_random_array
|
||||
{
|
||||
public NetworkSkill_random_array(NetworkBattleManagerBase battleManager, SkillParameter skillPrm, string option)
|
||||
: base(skillPrm, option)
|
||||
{
|
||||
NetworkSkill_random_array networkSkill_random_array = this;
|
||||
if (GameMgr.GetIns().IsAdminWatch || base.SkillPrm.ownerCard.IsPlayer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
base.OnSkillStart += delegate(SkillBase skill, List<BattleCardBase> targetsCard, SkillConditionCheckerOption checkeroption)
|
||||
{
|
||||
if (!targetsCard.Any((BattleCardBase c) => !c.IsInHand && !c.IsInDeck))
|
||||
{
|
||||
List<CardDataModel> receiveCardList = battleManager.networkBattleData.GetReceiveData().GetReceiveCardList();
|
||||
int i;
|
||||
for (i = 0; i < targetsCard.Count; i++)
|
||||
{
|
||||
CardDataModel cardDataModel = receiveCardList.SingleOrDefault((CardDataModel c) => c.Index == targetsCard[i].Index);
|
||||
if (cardDataModel != null && !(cardDataModel.AttachTarget == string.Empty))
|
||||
{
|
||||
string[] array = cardDataModel.AttachTarget.Split(',');
|
||||
for (int num = 0; num < array.Length; num++)
|
||||
{
|
||||
if (int.TryParse(array[num], out var targetSkillCount))
|
||||
{
|
||||
SkillBase skillBase = battleManager.PublishedSkillList.SingleOrDefault((SkillBase s) => s.PublishedActiveSkillCount == targetSkillCount);
|
||||
if (skillBase != null && skillBase.PreprocessList.SingleOrDefault((SkillPreprocessBase p) => p is SkillPreprocessRandomArrayIndex) is SkillPreprocessRandomArrayIndex skillPreprocessRandomArrayIndex)
|
||||
{
|
||||
networkSkill_random_array.AddSelectedIndex(targetsCard[i], skillPreprocessRandomArrayIndex.RandomIndexes.ToList());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void AddSelectedIndex(BattleCardBase key, List<int> values)
|
||||
{
|
||||
if (!base.SelectedIndex.ContainsKey(key))
|
||||
{
|
||||
base.SelectedIndex[key] = new List<int>();
|
||||
}
|
||||
for (int i = 0; i < values.Count; i++)
|
||||
{
|
||||
if (!base.SelectedIndex[key].Contains(values[i]))
|
||||
{
|
||||
base.SelectedIndex[key].Add(values[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user