123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- using System;
- using System.Collections.Generic;
- using MongoDB.Bson.Serialization.Attributes;
- using ProtoBuf;
- namespace ET
- {
- [ProtoContract]
- [Config]
- public partial class SkillConfigCategory : ConfigSingleton<SkillConfigCategory>, IMerge
- {
- [ProtoIgnore]
- [BsonIgnore]
- private Dictionary<int, SkillConfig> dict = new Dictionary<int, SkillConfig>();
-
- [BsonElement]
- [ProtoMember(1)]
- private List<SkillConfig> list = new List<SkillConfig>();
-
- public void Merge(object o)
- {
- SkillConfigCategory s = o as SkillConfigCategory;
- this.list.AddRange(s.list);
- }
-
- [ProtoAfterDeserialization]
- public void ProtoEndInit()
- {
- foreach (SkillConfig config in list)
- {
- config.AfterEndInit();
- this.dict.Add(config.Id, config);
- }
- this.list.Clear();
-
- this.AfterEndInit();
- }
-
- public SkillConfig Get(int id)
- {
- this.dict.TryGetValue(id, out SkillConfig item);
- if (item == null)
- {
- throw new Exception($"配置找不到,配置表名: {nameof (SkillConfig)},配置id: {id}");
- }
- return item;
- }
-
- public bool Contain(int id)
- {
- return this.dict.ContainsKey(id);
- }
- public Dictionary<int, SkillConfig> GetAll()
- {
- return this.dict;
- }
- public SkillConfig GetOne()
- {
- if (this.dict == null || this.dict.Count <= 0)
- {
- return null;
- }
- return this.dict.Values.GetEnumerator().Current;
- }
- }
- [ProtoContract]
- public partial class SkillConfig: ProtoObject, IConfig
- {
-
- [ProtoMember(1)]
- public int Id { get; set; }
-
- [ProtoMember(2)]
- public int SkillIndex { get; set; }
-
- [ProtoMember(3)]
- public string SkillName { get; set; }
-
- [ProtoMember(4)]
- public int ProId { get; set; }
-
- [ProtoMember(5)]
- public int Tab { get; set; }
-
- [ProtoMember(6)]
- public int SkillType { get; set; }
-
- [ProtoMember(7)]
- public string SkillDesc { get; set; }
-
- [ProtoMember(8)]
- public string UpDesc { get; set; }
-
- [ProtoMember(9)]
- public string SkillItemCode { get; set; }
-
- [ProtoMember(10)]
- public int MaxLevel { get; set; }
-
- [ProtoMember(11)]
- public int LearnSkill { get; set; }
-
- [ProtoMember(12)]
- public string SkillIcon { get; set; }
-
- [ProtoMember(13)]
- public string UpReqLevel { get; set; }
-
- [ProtoMember(14)]
- public string ResetReqLevel { get; set; }
-
- [ProtoMember(15)]
- public int UpReqLevel2 { get; set; }
-
- [ProtoMember(16)]
- public string UpCostGold { get; set; }
-
- [ProtoMember(17)]
- public string UpCostSP { get; set; }
-
- [ProtoMember(18)]
- public string UpCostItem { get; set; }
-
- [ProtoMember(19)]
- public string Power { get; set; }
-
- [ProtoMember(20)]
- public int BaseId { get; set; }
-
- [ProtoMember(21)]
- public int Pos { get; set; }
-
- [ProtoMember(22)]
- public int BranchType { get; set; }
-
- [ProtoMember(23)]
- public string StrongIcon { get; set; }
-
- [ProtoMember(24)]
- public int StrongUnLockPre { get; set; }
-
- [ProtoMember(25)]
- public string StrongBranchDesc { get; set; }
-
- [ProtoMember(27)]
- public string StrongName { get; set; }
- }
- }
|