using System; using System.Collections.Generic; using MongoDB.Bson.Serialization.Attributes; using ProtoBuf; namespace ET { [ProtoContract] [Config] public partial class UpLevelExpCategory : ConfigSingleton, IMerge { [ProtoIgnore] [BsonIgnore] private Dictionary dict = new Dictionary(); [BsonElement] [ProtoMember(1)] private List list = new List(); public void Merge(object o) { UpLevelExpCategory s = o as UpLevelExpCategory; this.list.AddRange(s.list); } [ProtoAfterDeserialization] public void ProtoEndInit() { foreach (UpLevelExp config in list) { config.AfterEndInit(); this.dict.Add(config.Id, config); } this.list.Clear(); this.AfterEndInit(); } public UpLevelExp Get(int id) { this.dict.TryGetValue(id, out UpLevelExp item); if (item == null) { throw new Exception($"配置找不到,配置表名: {nameof (UpLevelExp)},配置id: {id}"); } return item; } public bool Contain(int id) { return this.dict.ContainsKey(id); } public Dictionary GetAll() { return this.dict; } public UpLevelExp GetOne() { if (this.dict == null || this.dict.Count <= 0) { return null; } return this.dict.Values.GetEnumerator().Current; } } [ProtoContract] public partial class UpLevelExp: ProtoObject, IConfig { /// Id [ProtoMember(1)] public int Id { get; set; } /// 境界编号 [ProtoMember(2)] public int ClassID { get; set; } /// 境界名称 [ProtoMember(3)] public string ClassName { get; set; } /// 是否开启 [ProtoMember(4)] public int isValid { get; set; } /// 境界阶数 [ProtoMember(5)] public int ClassUPLevel { get; set; } /// 阶数名称 [ProtoMember(6)] public string UPName { get; set; } /// 成色 [ProtoMember(7)] public int Qcolor { get; set; } /// 提升境界所需人物等级 [ProtoMember(8)] public int ReqLevel { get; set; } /// 进阶需要完成事件 [ProtoMember(9)] public string ReqEvents { get; set; } /// 进阶所需修为 [ProtoMember(10)] public int ReqClassExp { get; set; } /// 属性1 [ProtoMember(11)] public string Prop1 { get; set; } /// 参数1 [ProtoMember(12)] public int Par1 { get; set; } /// 最小值1 [ProtoMember(13)] public int Min1 { get; set; } /// 最大值1 [ProtoMember(14)] public int Max1 { get; set; } /// 属性2 [ProtoMember(15)] public string Prop2 { get; set; } /// 参数2 [ProtoMember(16)] public int Par2 { get; set; } /// 最小值2 [ProtoMember(17)] public int Min2 { get; set; } /// 最大值2 [ProtoMember(18)] public int Max2 { get; set; } /// 属性3 [ProtoMember(19)] public string Prop3 { get; set; } /// 参数3 [ProtoMember(20)] public int Par3 { get; set; } /// 最小值3 [ProtoMember(21)] public int Min3 { get; set; } /// 最大值3 [ProtoMember(22)] public int Max3 { get; set; } /// 属性4 [ProtoMember(23)] public string Prop4 { get; set; } /// 参数4 [ProtoMember(24)] public int Par4 { get; set; } /// 最小值4 [ProtoMember(25)] public int Min4 { get; set; } /// 最大值4 [ProtoMember(26)] public int Max4 { get; set; } /// 属性5 [ProtoMember(27)] public string Prop5 { get; set; } /// 参数5 [ProtoMember(28)] public int Par5 { get; set; } /// 最小值5 [ProtoMember(29)] public int Min5 { get; set; } /// 最大值5 [ProtoMember(30)] public int Max5 { get; set; } } }