Files
SVSimServer/SVSim.BattleEngine/Engine/Wizard/AIBattleStartTask.cs
gamer147 957af3d1ec 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.
2026-06-05 17:22:20 -04:00

55 lines
2.8 KiB
C#

using LitJson;
namespace Wizard;
public class AIBattleStartTask : BaseTask
{
public AIBattleStartTask()
{
base.type = ((Data.CurrentFormat == Format.Rotation) ? ApiType.Type.AIRotationRankBattleStart : ApiType.Type.AIUnlimitedRankBattleStart);
}
protected override int Parse()
{
int num = base.Parse();
if (num != 1)
{
return num;
}
JsonData jsonData = base.ResponseData["data"];
Data.AIBattleStartData = new AIBattleStartData();
Data.AIBattleStartData.Data.AIid = (jsonData.Keys.Contains("ai_id") ? jsonData["ai_id"].ToInt() : (-1));
Data.AIBattleStartData.TurnState = (jsonData.Keys.Contains("turnState") ? jsonData["turnState"].ToInt() : (-1));
SetAIBattleStartDetail(Data.AIBattleStartData.Data.SelfInfo, jsonData, "self_info");
SetAIBattleStartDetail(Data.AIBattleStartData.Data.OppoInfo, jsonData, "oppo_info");
return num;
}
private void SetAIBattleStartDetail(AIBattleStartDetail.UserInfo info, JsonData data, string userKey)
{
JsonData jsonData = null;
if (data.Keys.Contains(userKey))
{
jsonData = data[userKey];
}
if (jsonData != null)
{
info.DataDictionary.Add("country_code", jsonData.Keys.Contains("country_code") ? jsonData["country_code"] : ((JsonData)"NONE"));
info.DataDictionary.Add("userName", jsonData.Keys.Contains("userName") ? jsonData["userName"] : ((JsonData)"NONE"));
info.DataDictionary.Add("sleeveId", jsonData.Keys.Contains("sleeveId") ? jsonData["sleeveId"].ToInt() : (-1));
info.DataDictionary.Add("emblemId", jsonData.Keys.Contains("emblemId") ? jsonData["emblemId"].ToInt() : (-1));
info.DataDictionary.Add("degreeId", jsonData.Keys.Contains("degreeId") ? jsonData["degreeId"].ToInt() : (-1));
info.DataDictionary.Add("fieldId", jsonData.Keys.Contains("fieldId") ? jsonData["fieldId"].ToInt() : (-1));
info.DataDictionary.Add("isOfficial", jsonData.Keys.Contains("isOfficial") ? jsonData["isOfficial"].ToInt() : (-1));
info.DataDictionary.Add("oppoId", jsonData.Keys.Contains("oppoId") ? jsonData["oppoId"].ToInt() : (-1));
info.DataDictionary.Add("seed", jsonData.Keys.Contains("seed") ? jsonData["seed"].ToInt() : (-1));
info.DataDictionary.Add("rank", jsonData.Keys.Contains("rank") ? jsonData["rank"].ToInt() : (-1));
info.DataDictionary.Add("battlePoint", jsonData.Keys.Contains("battlePoint") ? jsonData["battlePoint"].ToInt() : (-1));
info.DataDictionary.Add("classId", jsonData.Keys.Contains("classId") ? jsonData["classId"].ToInt() : (-1));
info.DataDictionary.Add("charaId", jsonData.Keys.Contains("charaId") ? jsonData["charaId"].ToInt() : (-1));
info.DataDictionary.Add("isMasterRank", jsonData.Keys.Contains("isMasterRank") ? jsonData["isMasterRank"].ToInt() : (-1));
info.DataDictionary.Add("masterPoint", jsonData.Keys.Contains("masterPoint") ? jsonData["masterPoint"].ToInt() : (-1));
}
}
}