feat(battle-engine): close the AI-simulation subsystem (verbatim)
Copied the 89 uncopied AI*SimulationUtility/extension files defining the AIVirtualCard/AIVirtualField extension methods; the compile loop then auto-closed the revealed type deps (~3049 files total, drift-clean). 10.0k -> 62 errors.
This commit is contained in:
125
SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryRewardData.cs
Normal file
125
SVSim.BattleEngine/Engine/Wizard.Lottery/LotteryRewardData.cs
Normal file
@@ -0,0 +1,125 @@
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard.Lottery;
|
||||
|
||||
public class LotteryRewardData
|
||||
{
|
||||
public class NormalGotRewardData
|
||||
{
|
||||
private string _textureName = string.Empty;
|
||||
|
||||
public UserGoods.Type RewardType { get; private set; }
|
||||
|
||||
public long RewardId { get; private set; }
|
||||
|
||||
public int RewardGotNum { get; private set; }
|
||||
|
||||
public string TextureName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_textureName == string.Empty)
|
||||
{
|
||||
_textureName = UserGoods.GetUserGoodsImageName(RewardType, RewardId);
|
||||
}
|
||||
return _textureName;
|
||||
}
|
||||
}
|
||||
|
||||
public NormalGotRewardData(UserGoods.Type reward_type, long reward_id, int reward_got_num)
|
||||
{
|
||||
RewardType = reward_type;
|
||||
RewardId = reward_id;
|
||||
RewardGotNum = reward_got_num;
|
||||
}
|
||||
}
|
||||
|
||||
public enum eLotteryRewardState
|
||||
{
|
||||
None,
|
||||
Unapplied,
|
||||
Applied,
|
||||
WaitResult,
|
||||
NotReceived,
|
||||
Received,
|
||||
NotAchieved
|
||||
}
|
||||
|
||||
public eLotteryRewardState state;
|
||||
|
||||
private JsonData NormalRewardList;
|
||||
|
||||
public int MissionId { get; private set; }
|
||||
|
||||
public int GradeId { get; private set; }
|
||||
|
||||
public bool IsCurrent { get; private set; }
|
||||
|
||||
public int LotteryId { get; private set; }
|
||||
|
||||
public string LotteryUrl { get; private set; }
|
||||
|
||||
public string DialogMessage { get; private set; }
|
||||
|
||||
public string Description { get; private set; }
|
||||
|
||||
public string PrizeMessage { get; private set; }
|
||||
|
||||
public List<NormalGotRewardData> NormalGotRewardList { get; private set; }
|
||||
|
||||
public LotteryMissionData MissionData { get; set; }
|
||||
|
||||
public bool IsSpecial
|
||||
{
|
||||
get
|
||||
{
|
||||
if (LotteryId <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public LotteryRewardData(JsonData lotteryRewardData)
|
||||
{
|
||||
MissionId = lotteryRewardData["mission_id"].ToInt();
|
||||
state = (eLotteryRewardState)lotteryRewardData["status"].ToInt();
|
||||
GradeId = lotteryRewardData["grade_id"].ToInt();
|
||||
IsCurrent = lotteryRewardData["is_current"].ToInt() == 1;
|
||||
LotteryId = lotteryRewardData["lottery_id"].ToInt();
|
||||
LotteryUrl = lotteryRewardData["lottery_url"].ToString();
|
||||
DialogMessage = lotteryRewardData["dialog_message"].ToString();
|
||||
NormalGotRewardList = ParseGotRewardList(lotteryRewardData["got_reward_list"]);
|
||||
PrizeMessage = lotteryRewardData.GetValueOrDefault("prize_message", string.Empty);
|
||||
if (lotteryRewardData.TryGetValue("reward_list", out var _))
|
||||
{
|
||||
NormalRewardList = lotteryRewardData["reward_list"];
|
||||
}
|
||||
Description = lotteryRewardData["description_message"].ToString().Replace("\\n", "\n");
|
||||
}
|
||||
|
||||
public void UpdateHaveUserGoodsByNormalRwardList()
|
||||
{
|
||||
if (NormalRewardList != null)
|
||||
{
|
||||
PlayerStaticData.UpdateHaveUserGoodsNumByJsonData(NormalRewardList);
|
||||
NormalRewardList = null;
|
||||
}
|
||||
}
|
||||
|
||||
private List<NormalGotRewardData> ParseGotRewardList(JsonData data)
|
||||
{
|
||||
List<NormalGotRewardData> list = new List<NormalGotRewardData>();
|
||||
for (int i = 0; i < data.Count; i++)
|
||||
{
|
||||
JsonData jsonData = data[i];
|
||||
UserGoods.Type reward_type = (UserGoods.Type)jsonData["reward_type"].ToInt();
|
||||
long reward_id = jsonData["reward_id"].ToLong();
|
||||
int reward_got_num = jsonData["reward_got_num"].ToInt();
|
||||
list.Add(new NormalGotRewardData(reward_type, reward_id, reward_got_num));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user