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

164 lines
8.0 KiB
C#
Raw Normal View History

2023-08-22 19:08:45 +08:00
//------------------------------------------------------------------------------
// <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["ChapterID"].IsNumber) { throw new SerializationException(); } ChapterID = _json["ChapterID"]; }
2023-10-19 15:00:19 +08:00
{ if(!_json["Index"].IsNumber) { throw new SerializationException(); } Index = _json["Index"]; }
2023-08-22 19:08:45 +08:00
{ 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; } }
2023-10-19 15:00:19 +08:00
{ var __json0 = _json["CostItems"]; if(!__json0.IsArray) { throw new SerializationException(); } CostItems = new System.Collections.Generic.List<item.ItemCounts>(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { item.ItemCounts __v0; { if(!__e0.IsObject) { throw new SerializationException(); } __v0 = item.ItemCounts.DeserializeItemCounts(__e0); } CostItems.Add(__v0); } }
{ var __json0 = _json["NormalRewardID"]; if(!__json0.IsArray) { throw new SerializationException(); } int _n0 = __json0.Count; NormalRewardID = new int[_n0]; int __index0=0; foreach(JSONNode __e0 in __json0.Children) { int __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } NormalRewardID[__index0++] = __v0; } }
{ var __json0 = _json["FristRewardID"]; if(!__json0.IsArray) { throw new SerializationException(); } int _n0 = __json0.Count; FristRewardID = new int[_n0]; int __index0=0; foreach(JSONNode __e0 in __json0.Children) { int __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } FristRewardID[__index0++] = __v0; } }
{ var __json0 = _json["StarRewardID_1"]; if(!__json0.IsArray) { throw new SerializationException(); } int _n0 = __json0.Count; StarRewardID1 = new int[_n0]; int __index0=0; foreach(JSONNode __e0 in __json0.Children) { int __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } StarRewardID1[__index0++] = __v0; } }
{ var __json0 = _json["StarRewardID_2"]; if(!__json0.IsArray) { throw new SerializationException(); } int _n0 = __json0.Count; StarRewardID2 = new int[_n0]; int __index0=0; foreach(JSONNode __e0 in __json0.Children) { int __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } StarRewardID2[__index0++] = __v0; } }
{ var __json0 = _json["StarRewardID_3"]; if(!__json0.IsArray) { throw new SerializationException(); } int _n0 = __json0.Count; StarRewardID3 = new int[_n0]; int __index0=0; foreach(JSONNode __e0 in __json0.Children) { int __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } StarRewardID3[__index0++] = __v0; } }
{ if(!_json["SettleExp"].IsNumber) { throw new SerializationException(); } SettleExp = _json["SettleExp"]; }
{ if(!_json["SettleLikability"].IsNumber) { throw new SerializationException(); } SettleLikability = _json["SettleLikability"]; }
{ if(!_json["FileName"].IsString) { throw new SerializationException(); } FileName = _json["FileName"]; }
{ if(!_json["Name"].IsString) { throw new SerializationException(); } Name = _json["Name"]; }
{ if(!_json["Desc"].IsString) { throw new SerializationException(); } Desc = _json["Desc"]; }
2023-08-22 19:08:45 +08:00
PostInit();
}
2023-10-19 15:00:19 +08:00
public DataLevel(int Id, int ChapterID, int Index, int[] Unlock, System.Collections.Generic.List<item.ItemCounts> CostItems, int[] NormalRewardID, int[] FristRewardID, int[] StarRewardID_1, int[] StarRewardID_2, int[] StarRewardID_3, int SettleExp, int SettleLikability, string FileName, string Name, string Desc )
2023-08-22 19:08:45 +08:00
{
this.Id = Id;
this.ChapterID = ChapterID;
2023-10-19 15:00:19 +08:00
this.Index = Index;
2023-08-22 19:08:45 +08:00
this.Unlock = Unlock;
2023-10-19 15:00:19 +08:00
this.CostItems = CostItems;
this.NormalRewardID = NormalRewardID;
this.FristRewardID = FristRewardID;
this.StarRewardID1 = StarRewardID_1;
this.StarRewardID2 = StarRewardID_2;
this.StarRewardID3 = StarRewardID_3;
this.SettleExp = SettleExp;
this.SettleLikability = SettleLikability;
this.FileName = FileName;
this.Name = Name;
this.Desc = Desc;
2023-08-22 19:08:45 +08:00
PostInit();
}
public static DataLevel DeserializeDataLevel(JSONNode _json)
{
return new LevelCfg.DataLevel(_json);
}
/// <summary>
/// 关卡ID
/// </summary>
public int Id { get; private set; }
/// <summary>
/// 章节Id
/// </summary>
public int ChapterID { get; private set; }
/// <summary>
2023-10-19 15:00:19 +08:00
/// 序列号同一chapter中排序
/// </summary>
public int Index { get; private set; }
/// <summary>
2023-08-22 19:08:45 +08:00
/// 解锁条件
/// </summary>
public int[] Unlock { get; private set; }
/// <summary>
2023-10-19 15:00:19 +08:00
/// 消耗道具
/// </summary>
public System.Collections.Generic.List<item.ItemCounts> CostItems { get; private set; }
/// <summary>
/// 常规通关奖励
/// </summary>
public int[] NormalRewardID { get; private set; }
/// <summary>
/// 首次通关奖励
/// </summary>
public int[] FristRewardID { get; private set; }
/// <summary>
/// 首通一星奖励
/// </summary>
public int[] StarRewardID1 { get; private set; }
/// <summary>
/// 首通二星奖励
/// </summary>
public int[] StarRewardID2 { get; private set; }
/// <summary>
/// 首通三星奖励
/// </summary>
public int[] StarRewardID3 { get; private set; }
/// <summary>
/// 结算经验
/// </summary>
public int SettleExp { get; private set; }
/// <summary>
/// 结算好感度
/// </summary>
public int SettleLikability { get; private set; }
/// <summary>
/// 文件名
/// </summary>
public string FileName { get; private set; }
/// <summary>
/// 关卡名字
2023-08-22 19:08:45 +08:00
/// </summary>
2023-10-19 15:00:19 +08:00
public string Name { get; private set; }
2023-08-22 19:08:45 +08:00
/// <summary>
2023-10-19 15:00:19 +08:00
/// 关卡描述
2023-08-22 19:08:45 +08:00
/// </summary>
2023-10-19 15:00:19 +08:00
public string Desc { get; private set; }
2023-08-22 19:08:45 +08:00
public const int __ID__ = -1884167220;
public override int GetTypeId() => __ID__;
public void Resolve(Dictionary<string, object> _tables)
{
2023-10-19 15:00:19 +08:00
foreach(var _e in CostItems) { _e?.Resolve(_tables); }
2023-08-22 19:08:45 +08:00
PostResolve();
}
public void TranslateText(System.Func<string, string, string> translator)
{
2023-10-19 15:00:19 +08:00
foreach(var _e in CostItems) { _e?.TranslateText(translator); }
2023-08-22 19:08:45 +08:00
}
public override string ToString()
{
return "{ "
+ "Id:" + Id + ","
+ "ChapterID:" + ChapterID + ","
2023-10-19 15:00:19 +08:00
+ "Index:" + Index + ","
2023-08-22 19:08:45 +08:00
+ "Unlock:" + Bright.Common.StringUtil.CollectionToString(Unlock) + ","
2023-10-19 15:00:19 +08:00
+ "CostItems:" + Bright.Common.StringUtil.CollectionToString(CostItems) + ","
+ "NormalRewardID:" + Bright.Common.StringUtil.CollectionToString(NormalRewardID) + ","
+ "FristRewardID:" + Bright.Common.StringUtil.CollectionToString(FristRewardID) + ","
+ "StarRewardID1:" + Bright.Common.StringUtil.CollectionToString(StarRewardID1) + ","
+ "StarRewardID2:" + Bright.Common.StringUtil.CollectionToString(StarRewardID2) + ","
+ "StarRewardID3:" + Bright.Common.StringUtil.CollectionToString(StarRewardID3) + ","
+ "SettleExp:" + SettleExp + ","
+ "SettleLikability:" + SettleLikability + ","
+ "FileName:" + FileName + ","
+ "Name:" + Name + ","
+ "Desc:" + Desc + ","
2023-08-22 19:08:45 +08:00
+ "}";
}
partial void PostInit();
partial void PostResolve();
}
}