Files
SVSimServer/SVSim.BattleEngine/Engine/Wizard/PrereleasePurchaseInfo.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

75 lines
2.3 KiB
C#

using System.Collections.Generic;
using LitJson;
using UnityEngine;
namespace Wizard;
public class PrereleasePurchaseInfo
{
public int CurrentCount { get; private set; }
public int LimitCount { get; private set; }
public int PreReleasePointCurent { get; private set; }
public int PreReleasePointLimit { get; private set; }
public int TicketRupyCountCurrent { get; private set; }
public int TicketRupyCountLimit { get; private set; }
public int TicketRupyCountRemain
{
get
{
int a = LimitCount - CurrentCount;
int b = TicketRupyCountLimit - TicketRupyCountCurrent;
return Mathf.Min(a, b);
}
}
public RemainTime RemainTime { get; private set; }
public List<PurchaseRewardInfo> RewardsList { get; private set; }
public bool IsCountLimitedPrerelease => LimitCount != 0;
public PrereleasePurchaseInfo(JsonData json, double serverTime)
{
CurrentCount = json["purchase_count"].ToInt();
LimitCount = json["purchase_limit_count"].ToInt();
PreReleasePointCurent = json["pre_release_point"].ToInt();
PreReleasePointLimit = json["pre_release_point_limit"].ToInt();
TicketRupyCountCurrent = json["open_count_by_ticket_and_rupy"].ToInt();
TicketRupyCountLimit = json["open_count_limit_by_ticket_and_rupy"].ToInt();
RemainTime = new RemainTime(Prerelease.Instance.EndTime.ToString(), serverTime);
RewardsList = new List<PurchaseRewardInfo>();
JsonData jsonData = json["purchase_reward_list"];
for (int i = 0; i < jsonData.Count; i++)
{
JsonData jsonData2 = jsonData[i];
PurchaseRewardInfo purchaseRewardInfo = new PurchaseRewardInfo();
JsonData jsonData3 = jsonData2["reward_list"];
for (int j = 0; j < jsonData3.Count; j++)
{
ShopCommonRewardInfo item = new ShopCommonRewardInfo
{
Type = jsonData3[j]["reward_type"].ToInt(),
UserGoodsId = jsonData3[j]["reward_detail_id"].ToLong(),
Num = jsonData3[j]["reward_number"].ToInt()
};
purchaseRewardInfo.RewardInfoList.Add(item);
}
int num = jsonData2["purchase_count"].ToInt();
purchaseRewardInfo.PurchaseNthText = Data.SystemText.Get("Shop_0205", num.ToString());
purchaseRewardInfo.IsGet = jsonData2["is_received"].ToBoolean();
RewardsList.Add(purchaseRewardInfo);
}
}
public int GetAbleBuyPackNum()
{
return LimitCount - CurrentCount;
}
}