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