//------------------------------------------------------------------------------
//
// 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 BattlePassTask : Bright.Config.BeanBase
{
public JSONNode json;
public BattlePassTask(JSONNode _json)
{
{ if(!_json["TaskID"].IsNumber) { throw new SerializationException(); } TaskID = _json["TaskID"]; }
{ if(!_json["Desc"]["key"].IsString) { throw new SerializationException(); } Desc_l10n_key = _json["Desc"]["key"]; if(!_json["Desc"]["text"].IsString) { throw new SerializationException(); } Desc = _json["Desc"]["text"]; }
{ if(!_json["Type"].IsNumber) { throw new SerializationException(); } Type = (ConditionType)_json["Type"].AsInt; }
{ var __json0 = _json["Param"]; if(!__json0.IsArray) { throw new SerializationException(); } Param = new System.Collections.Generic.List(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { string __v0; { if(!__e0.IsString) { throw new SerializationException(); } __v0 = __e0; } Param.Add(__v0); } }
{ if(!_json["Reward"].IsNumber) { throw new SerializationException(); } Reward = _json["Reward"]; }
json = _json;
PostInit();
}
public BattlePassTask(int TaskID, string Desc, ConditionType Type, System.Collections.Generic.List Param, int Reward )
{
this.TaskID = TaskID;
this.Desc = Desc;
this.Type = Type;
this.Param = Param;
this.Reward = Reward;
PostInit();
}
public static BattlePassTask DeserializeBattlePassTask(JSONNode _json)
{
return new BattlePassTask(_json);
}
public int TaskID { get; private set; }
///
/// key
///
public string Desc { get; private set; }
public string Desc_l10n_key { get; }
public ConditionType Type { get; private set; }
///
/// 逗号隔开
///
public System.Collections.Generic.List Param { get; private set; }
///
/// DropID,第一位是战令经验,第二位是道具
///
public int Reward { get; private set; }
public const int __ID__ = 1765991982;
public override int GetTypeId() => __ID__;
public void Resolve(Dictionary _tables)
{
PostResolve();
}
public void TranslateText(System.Func translator)
{
Desc = translator(Desc_l10n_key, Desc);
}
public override string ToString()
{
return "{ "
+ "TaskID:" + TaskID + ","
+ "Desc:" + Desc + ","
+ "Type:" + Type + ","
+ "Param:" + Bright.Common.StringUtil.CollectionToString(Param) + ","
+ "Reward:" + Reward + ","
+ "}";
}
partial void PostInit();
partial void PostResolve();
}
}