123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- using System;
- using System.Collections.Generic;
- using MongoDB.Bson.Serialization.Attributes;
- using ProtoBuf;
- namespace ET
- {
- [ProtoContract]
- [Config]
- public partial class UpLevelExpCategory : ConfigSingleton<UpLevelExpCategory>, IMerge
- {
- [ProtoIgnore]
- [BsonIgnore]
- private Dictionary<int, UpLevelExp> dict = new Dictionary<int, UpLevelExp>();
-
- [BsonElement]
- [ProtoMember(1)]
- private List<UpLevelExp> list = new List<UpLevelExp>();
-
- 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<int, UpLevelExp> 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
- {
- /// <summary>Id</summary>
- [ProtoMember(1)]
- public int Id { get; set; }
- /// <summary>境界编号</summary>
- [ProtoMember(2)]
- public int ClassID { get; set; }
- /// <summary>境界名称</summary>
- [ProtoMember(3)]
- public string ClassName { get; set; }
- /// <summary>是否开启</summary>
- [ProtoMember(4)]
- public int isValid { get; set; }
- /// <summary>境界阶数</summary>
- [ProtoMember(5)]
- public int ClassUPLevel { get; set; }
- /// <summary>阶数名称</summary>
- [ProtoMember(6)]
- public string UPName { get; set; }
- /// <summary>成色</summary>
- [ProtoMember(7)]
- public int Qcolor { get; set; }
- /// <summary>提升境界所需人物等级</summary>
- [ProtoMember(8)]
- public int ReqLevel { get; set; }
- /// <summary>进阶需要完成事件</summary>
- [ProtoMember(9)]
- public string ReqEvents { get; set; }
- /// <summary>进阶所需修为</summary>
- [ProtoMember(10)]
- public int ReqClassExp { get; set; }
- /// <summary>属性1</summary>
- [ProtoMember(11)]
- public string Prop1 { get; set; }
- /// <summary>参数1</summary>
- [ProtoMember(12)]
- public int Par1 { get; set; }
- /// <summary>最小值1</summary>
- [ProtoMember(13)]
- public int Min1 { get; set; }
- /// <summary>最大值1</summary>
- [ProtoMember(14)]
- public int Max1 { get; set; }
- /// <summary>属性2</summary>
- [ProtoMember(15)]
- public string Prop2 { get; set; }
- /// <summary>参数2</summary>
- [ProtoMember(16)]
- public int Par2 { get; set; }
- /// <summary>最小值2</summary>
- [ProtoMember(17)]
- public int Min2 { get; set; }
- /// <summary>最大值2</summary>
- [ProtoMember(18)]
- public int Max2 { get; set; }
- /// <summary>属性3</summary>
- [ProtoMember(19)]
- public string Prop3 { get; set; }
- /// <summary>参数3</summary>
- [ProtoMember(20)]
- public int Par3 { get; set; }
- /// <summary>最小值3</summary>
- [ProtoMember(21)]
- public int Min3 { get; set; }
- /// <summary>最大值3</summary>
- [ProtoMember(22)]
- public int Max3 { get; set; }
- /// <summary>属性4</summary>
- [ProtoMember(23)]
- public string Prop4 { get; set; }
- /// <summary>参数4</summary>
- [ProtoMember(24)]
- public int Par4 { get; set; }
- /// <summary>最小值4</summary>
- [ProtoMember(25)]
- public int Min4 { get; set; }
- /// <summary>最大值4</summary>
- [ProtoMember(26)]
- public int Max4 { get; set; }
- /// <summary>属性5</summary>
- [ProtoMember(27)]
- public string Prop5 { get; set; }
- /// <summary>参数5</summary>
- [ProtoMember(28)]
- public int Par5 { get; set; }
- /// <summary>最小值5</summary>
- [ProtoMember(29)]
- public int Min5 { get; set; }
- /// <summary>最大值5</summary>
- [ProtoMember(30)]
- public int Max5 { get; set; }
- }
- }
|