Files
SVSimServer/SVSim.BattleEngine/Engine/Wizard.Scripts.Network.Data.TaskData.SpotCardExchange/SpotCardExchangeInfoTask.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

78 lines
2.4 KiB
C#

using System.Collections.Generic;
using LitJson;
namespace Wizard.Scripts.Network.Data.TaskData.SpotCardExchange;
public class SpotCardExchangeInfoTask : BaseTask
{
public class PrereleaseExchangeInfo
{
private int _exchangeablePrereleaseCardLimit;
private int _exchangedPrereleaseCardCount;
public bool IsPrerelease { get; private set; }
public int RemainingExchangeableCount
{
get
{
if (IsPrerelease)
{
return _exchangeablePrereleaseCardLimit - _exchangedPrereleaseCardCount;
}
return 0;
}
}
public PrereleaseExchangeInfo(JsonData jsonData)
{
IsPrerelease = jsonData["is_pre_release"].ToBoolean();
_exchangeablePrereleaseCardLimit = jsonData["pre_release_spot_card_exchange_limit"].ToInt();
_exchangedPrereleaseCardCount = jsonData["pre_release_spot_card_exchange_count"].ToInt();
}
}
public Dictionary<CardBasePrm.ClanType, List<SpotCardExchangeInfo>> ExchangeableSpotCardListInClassDict { get; private set; }
public int NextCycleOutPackId { get; private set; }
public PrereleaseExchangeInfo PrereleaseInfo { get; private set; }
public SpotCardExchangeInfoTask()
{
base.type = ApiType.Type.SpotCardInfo;
}
protected override int Parse()
{
int num = base.Parse();
if (num != 1)
{
return num;
}
JsonData jsonData = base.ResponseData["data"];
PlayerStaticData.UserSpotCardPointCount = jsonData["spot_point"].ToInt();
ExchangeableSpotCardListInClassDict = new Dictionary<CardBasePrm.ClanType, List<SpotCardExchangeInfo>>();
for (CardBasePrm.ClanType clanType = CardBasePrm.ClanType.ALL; clanType < CardBasePrm.ClanType.MAX; clanType++)
{
ExchangeableSpotCardListInClassDict[clanType] = new List<SpotCardExchangeInfo>();
JsonData jsonData2 = jsonData["exchangeable_card_list"][(int)clanType];
List<string> list = new List<string>(jsonData2.Keys);
for (int i = 0; i < list.Count; i++)
{
JsonData jsonData3 = jsonData2[list[i]];
for (int j = 0; j < jsonData3.Count; j++)
{
SpotCardExchangeInfo item = new SpotCardExchangeInfo(jsonData3[j], int.Parse(list[i]));
ExchangeableSpotCardListInClassDict[clanType].Add(item);
}
}
}
int.TryParse(jsonData["soon_cycle_out_card_set_id"].ToString(), out var result);
NextCycleOutPackId = result;
PrereleaseInfo = new PrereleaseExchangeInfo(jsonData["pre_relase_info"]);
return num;
}
}