//------------------------------------------------------------------------------
//
// 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 RankInit : Bright.Config.BeanBase
{
public JSONNode json;
public RankInit(JSONNode _json)
{
{ if(!_json["ID"].IsNumber) { throw new SerializationException(); } ID = _json["ID"]; }
{ 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["SpecialShow"].IsNumber) { throw new SerializationException(); } SpecialShow = _json["SpecialShow"]; }
{ if(!_json["TokenID"].IsNumber) { throw new SerializationException(); } TokenID = _json["TokenID"]; }
{ if(!_json["BgTitle"].IsString) { throw new SerializationException(); } BgTitle = _json["BgTitle"]; }
{ var __json0 = _json["PointRobbery"]; if(!__json0.IsArray) { throw new SerializationException(); } PointRobbery = new System.Collections.Generic.List(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { int __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } PointRobbery.Add(__v0); } }
{ var __json0 = _json["PointDestruction"]; if(!__json0.IsArray) { throw new SerializationException(); } PointDestruction = new System.Collections.Generic.List(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { int __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } PointDestruction.Add(__v0); } }
{ if(!_json["Icon"].IsString) { throw new SerializationException(); } Icon = _json["Icon"]; }
{ if(!_json["UnlockPoint"].IsNumber) { throw new SerializationException(); } UnlockPoint = _json["UnlockPoint"]; }
{ if(!_json["PlayerCount"].IsNumber) { throw new SerializationException(); } PlayerCount = _json["PlayerCount"]; }
{ if(!_json["HoldTime"].IsNumber) { throw new SerializationException(); } HoldTime = _json["HoldTime"]; }
{ var __json0 = _json["TargetList"]; if(!__json0.IsArray) { throw new SerializationException(); } TargetList = new System.Collections.Generic.List(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { int __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } TargetList.Add(__v0); } }
json = _json;
PostInit();
}
public RankInit(int ID, string Title, int SpecialShow, int TokenID, string BgTitle, System.Collections.Generic.List PointRobbery, System.Collections.Generic.List PointDestruction, string Icon, int UnlockPoint, int PlayerCount, int HoldTime, System.Collections.Generic.List TargetList )
{
this.ID = ID;
this.Title = Title;
this.SpecialShow = SpecialShow;
this.TokenID = TokenID;
this.BgTitle = BgTitle;
this.PointRobbery = PointRobbery;
this.PointDestruction = PointDestruction;
this.Icon = Icon;
this.UnlockPoint = UnlockPoint;
this.PlayerCount = PlayerCount;
this.HoldTime = HoldTime;
this.TargetList = TargetList;
PostInit();
}
public static RankInit DeserializeRankInit(JSONNode _json)
{
return new RankInit(_json);
}
public int ID { get; private set; }
public string Title { get; private set; }
public string Title_l10n_key { get; }
///
/// 前X名做特殊展示
///
public int SpecialShow { get; private set; }
///
/// 对应Item表主键
///
public int TokenID { get; private set; }
public string BgTitle { get; private set; }
///
/// 被阻挡奖励积分
///
public System.Collections.Generic.List PointRobbery { get; private set; }
///
/// 被阻挡奖励积分
///
public System.Collections.Generic.List PointDestruction { get; private set; }
public string Icon { get; private set; }
public int UnlockPoint { get; private set; }
public int PlayerCount { get; private set; }
///
/// 单位秒,在这段时间内:
1. 玩家可以领奖
2. RankFormula可以保存
///
public int HoldTime { get; private set; }
///
/// 对应RankTargets主键
///
public System.Collections.Generic.List TargetList { get; private set; }
public const int __ID__ = 320377724;
public override int GetTypeId() => __ID__;
public void Resolve(Dictionary _tables)
{
PostResolve();
}
public void TranslateText(System.Func translator)
{
Title = translator(Title_l10n_key, Title);
}
public override string ToString()
{
return "{ "
+ "ID:" + ID + ","
+ "Title:" + Title + ","
+ "SpecialShow:" + SpecialShow + ","
+ "TokenID:" + TokenID + ","
+ "BgTitle:" + BgTitle + ","
+ "PointRobbery:" + Bright.Common.StringUtil.CollectionToString(PointRobbery) + ","
+ "PointDestruction:" + Bright.Common.StringUtil.CollectionToString(PointDestruction) + ","
+ "Icon:" + Icon + ","
+ "UnlockPoint:" + UnlockPoint + ","
+ "PlayerCount:" + PlayerCount + ","
+ "HoldTime:" + HoldTime + ","
+ "TargetList:" + Bright.Common.StringUtil.CollectionToString(TargetList) + ","
+ "}";
}
partial void PostInit();
partial void PostResolve();
}
}