//------------------------------------------------------------------------------
//
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
//------------------------------------------------------------------------------
using Bright.Serialization;
using System.Collections.Generic;
using SimpleJSON;
namespace cfg
{
public sealed partial class CollectingTargetInit : Bright.Config.BeanBase
{
public JSONNode json;
public CollectingTargetInit(JSONNode _json)
{
{ if(!_json["TaskID"].IsNumber) { throw new SerializationException(); } TaskID = _json["TaskID"]; }
{ if(!_json["Title"]["key"].IsString) { throw new SerializationException(); } Title_l10n_key = _json["Title"]["key"]; if(!_json["Title"]["text"].IsString) { throw new SerializationException(); } Title = _json["Title"]["text"]; }
{ if(!_json["TokenID"].IsNumber) { throw new SerializationException(); } TokenID = _json["TokenID"]; }
{ if(!_json["BasicProb"].IsNumber) { throw new SerializationException(); } BasicProb = _json["BasicProb"]; }
{ if(!_json["DownloadPkg"].IsString) { throw new SerializationException(); } DownloadPkg = _json["DownloadPkg"]; }
{ if(!_json["FishingExtraDrop"].IsObject) { throw new SerializationException(); } FishingExtraDrop = EventTargetExtraDrop.DeserializeEventTargetExtraDrop(_json["FishingExtraDrop"]); }
{ var __json0 = _json["TargetGroupByHook"]; if(!__json0.IsArray) { throw new SerializationException(); } TargetGroupByHook = new System.Collections.Generic.List(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { int __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } TargetGroupByHook.Add(__v0); } }
{ var __json0 = _json["TargetList"]; if(!__json0.IsArray) { throw new SerializationException(); } TargetList = new System.Collections.Generic.List>(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { System.Collections.Generic.List __v0; { var __json1 = __e0; if(!__json1.IsArray) { throw new SerializationException(); } __v0 = new System.Collections.Generic.List(__json1.Count); foreach(JSONNode __e1 in __json1.Children) { int __v1; { if(!__e1.IsNumber) { throw new SerializationException(); } __v1 = __e1; } __v0.Add(__v1); } } TargetList.Add(__v0); } }
{ if(!_json["BgRewardAdd"].IsString) { throw new SerializationException(); } BgRewardAdd = _json["BgRewardAdd"]; }
{ if(!_json["BuffIcon"].IsString) { throw new SerializationException(); } BuffIcon = _json["BuffIcon"]; }
{ if(!_json["BgTitle"].IsString) { throw new SerializationException(); } BgTitle = _json["BgTitle"]; }
{ if(!_json["BgDescPrefab"].IsString) { throw new SerializationException(); } BgDescPrefab = _json["BgDescPrefab"]; }
{ if(!_json["GiftIcon"].IsString) { throw new SerializationException(); } GiftIcon = _json["GiftIcon"]; }
json = _json;
PostInit();
}
public CollectingTargetInit(int TaskID, string Title, int TokenID, float BasicProb, string DownloadPkg, EventTargetExtraDrop FishingExtraDrop, System.Collections.Generic.List TargetGroupByHook, System.Collections.Generic.List> TargetList, string BgRewardAdd, string BuffIcon, string BgTitle, string BgDescPrefab, string GiftIcon )
{
this.TaskID = TaskID;
this.Title = Title;
this.TokenID = TokenID;
this.BasicProb = BasicProb;
this.DownloadPkg = DownloadPkg;
this.FishingExtraDrop = FishingExtraDrop;
this.TargetGroupByHook = TargetGroupByHook;
this.TargetList = TargetList;
this.BgRewardAdd = BgRewardAdd;
this.BuffIcon = BuffIcon;
this.BgTitle = BgTitle;
this.BgDescPrefab = BgDescPrefab;
this.GiftIcon = GiftIcon;
PostInit();
}
public static CollectingTargetInit DeserializeCollectingTargetInit(JSONNode _json)
{
return new CollectingTargetInit(_json);
}
public int TaskID { get; private set; }
///
/// key
///
public string Title { get; private set; }
public string Title_l10n_key { get; }
///
/// 对应Item表主键
///
public int TokenID { get; private set; }
///
/// 每次钓鱼时优先计算
///
public float BasicProb { get; private set; }
///
/// pkgDownloads/EventTarget/下的对应名字
会加载对应文件夹内的内容
///
public string DownloadPkg { get; private set; }
///
/// 具体参数详见beans表
///
public EventTargetExtraDrop FishingExtraDrop { get; private set; }
///
/// 根据活动开始时,玩家当前的体力数值,采用不同任务列表
///
public System.Collections.Generic.List TargetGroupByHook { get; private set; }
///
/// 不同体力档位下的分组,对应Target主键
///
public System.Collections.Generic.List> TargetList { get; private set; }
public string BgRewardAdd { get; private set; }
public string BuffIcon { get; private set; }
///
/// 主界面的banner
///
public string BgTitle { get; private set; }
public string BgDescPrefab { get; private set; }
public string GiftIcon { get; private set; }
public const int __ID__ = 1983587065;
public override int GetTypeId() => __ID__;
public void Resolve(Dictionary _tables)
{
FishingExtraDrop?.Resolve(_tables);
PostResolve();
}
public void TranslateText(System.Func translator)
{
Title = translator(Title_l10n_key, Title);
FishingExtraDrop?.TranslateText(translator);
}
public override string ToString()
{
return "{ "
+ "TaskID:" + TaskID + ","
+ "Title:" + Title + ","
+ "TokenID:" + TokenID + ","
+ "BasicProb:" + BasicProb + ","
+ "DownloadPkg:" + DownloadPkg + ","
+ "FishingExtraDrop:" + FishingExtraDrop + ","
+ "TargetGroupByHook:" + Bright.Common.StringUtil.CollectionToString(TargetGroupByHook) + ","
+ "TargetList:" + Bright.Common.StringUtil.CollectionToString(TargetList) + ","
+ "BgRewardAdd:" + BgRewardAdd + ","
+ "BuffIcon:" + BuffIcon + ","
+ "BgTitle:" + BgTitle + ","
+ "BgDescPrefab:" + BgDescPrefab + ","
+ "GiftIcon:" + GiftIcon + ","
+ "}";
}
partial void PostInit();
partial void PostResolve();
}
}