NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/Gameplay/DataTable/LevelCfg/DataLevel.cs

99 lines
3.7 KiB
C#

//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using Bright.Serialization;
using System.Collections.Generic;
using SimpleJSON;
namespace cfg.LevelCfg
{
public sealed partial class DataLevel : Bright.Config.BeanBase
{
public DataLevel(JSONNode _json)
{
{ if(!_json["Id"].IsNumber) { throw new SerializationException(); } Id = _json["Id"]; }
{ if(!_json["Type"].IsNumber) { throw new SerializationException(); } Type = (LevelCfg.LevelType)_json["Type"].AsInt; }
{ if(!_json["ChapterID"].IsNumber) { throw new SerializationException(); } ChapterID = _json["ChapterID"]; }
{ var __json0 = _json["Unlock"]; if(!__json0.IsArray) { throw new SerializationException(); } int _n0 = __json0.Count; Unlock = new int[_n0]; int __index0=0; foreach(JSONNode __e0 in __json0.Children) { int __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } Unlock[__index0++] = __v0; } }
{ var __json0 = _json["CostID"]; if(!__json0.IsArray) { throw new SerializationException(); } int _n0 = __json0.Count; CostID = new int[_n0]; int __index0=0; foreach(JSONNode __e0 in __json0.Children) { int __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } CostID[__index0++] = __v0; } }
{ var __json0 = _json["CostCount"]; if(!__json0.IsArray) { throw new SerializationException(); } int _n0 = __json0.Count; CostCount = new int[_n0]; int __index0=0; foreach(JSONNode __e0 in __json0.Children) { int __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } CostCount[__index0++] = __v0; } }
PostInit();
}
public DataLevel(int Id, LevelCfg.LevelType Type, int ChapterID, int[] Unlock, int[] CostID, int[] CostCount )
{
this.Id = Id;
this.Type = Type;
this.ChapterID = ChapterID;
this.Unlock = Unlock;
this.CostID = CostID;
this.CostCount = CostCount;
PostInit();
}
public static DataLevel DeserializeDataLevel(JSONNode _json)
{
return new LevelCfg.DataLevel(_json);
}
/// <summary>
/// 关卡ID
/// </summary>
public int Id { get; private set; }
/// <summary>
/// 关卡类型
/// </summary>
public LevelCfg.LevelType Type { get; private set; }
/// <summary>
/// 章节Id
/// </summary>
public int ChapterID { get; private set; }
/// <summary>
/// 解锁条件
/// </summary>
public int[] Unlock { get; private set; }
/// <summary>
/// 消耗ID
/// </summary>
public int[] CostID { get; private set; }
/// <summary>
/// 消耗Count
/// </summary>
public int[] CostCount { get; private set; }
public const int __ID__ = -1884167220;
public override int GetTypeId() => __ID__;
public void Resolve(Dictionary<string, object> _tables)
{
PostResolve();
}
public void TranslateText(System.Func<string, string, string> translator)
{
}
public override string ToString()
{
return "{ "
+ "Id:" + Id + ","
+ "Type:" + Type + ","
+ "ChapterID:" + ChapterID + ","
+ "Unlock:" + Bright.Common.StringUtil.CollectionToString(Unlock) + ","
+ "CostID:" + Bright.Common.StringUtil.CollectionToString(CostID) + ","
+ "CostCount:" + Bright.Common.StringUtil.CollectionToString(CostCount) + ","
+ "}";
}
partial void PostInit();
partial void PostResolve();
}
}