You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
122 lines
3.2 KiB
122 lines
3.2 KiB
3 years ago
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using MongoDB.Bson.Serialization.Attributes;
|
||
|
using ProtoBuf;
|
||
|
|
||
|
namespace ET
|
||
|
{
|
||
|
[ProtoContract]
|
||
|
[Config]
|
||
|
public partial class SkillUpConfigCategory : ProtoObject, IMerge
|
||
|
{
|
||
|
public static SkillUpConfigCategory Instance;
|
||
|
|
||
|
[ProtoIgnore]
|
||
|
[BsonIgnore]
|
||
|
private Dictionary<int, SkillUpConfig> dict = new Dictionary<int, SkillUpConfig>();
|
||
|
|
||
|
[BsonElement]
|
||
|
[ProtoMember(1)]
|
||
|
private List<SkillUpConfig> list = new List<SkillUpConfig>();
|
||
|
|
||
|
public SkillUpConfigCategory()
|
||
|
{
|
||
|
Instance = this;
|
||
|
}
|
||
|
|
||
|
public void Merge(object o)
|
||
|
{
|
||
|
SkillUpConfigCategory s = o as SkillUpConfigCategory;
|
||
|
this.list.AddRange(s.list);
|
||
|
}
|
||
|
|
||
|
public override void EndInit()
|
||
|
{
|
||
|
foreach (SkillUpConfig config in list)
|
||
|
{
|
||
|
config.EndInit();
|
||
|
this.dict.Add(config.Id, config);
|
||
|
}
|
||
|
this.AfterEndInit();
|
||
|
}
|
||
|
|
||
|
public SkillUpConfig Get(int id)
|
||
|
{
|
||
|
this.dict.TryGetValue(id, out SkillUpConfig item);
|
||
|
|
||
|
if (item == null)
|
||
|
{
|
||
|
throw new Exception($"配置找不到,配置表名: {nameof (SkillUpConfig)},配置id: {id}");
|
||
|
}
|
||
|
|
||
|
return item;
|
||
|
}
|
||
|
|
||
|
public bool Contain(int id)
|
||
|
{
|
||
|
return this.dict.ContainsKey(id);
|
||
|
}
|
||
|
|
||
|
public Dictionary<int, SkillUpConfig> GetAll()
|
||
|
{
|
||
|
return this.dict;
|
||
|
}
|
||
|
|
||
|
public List<SkillUpConfig> GetList()
|
||
|
{
|
||
|
return this.list;
|
||
|
}
|
||
|
|
||
|
public SkillUpConfig GetOne()
|
||
|
{
|
||
|
if (this.dict == null || this.dict.Count <= 0)
|
||
|
{
|
||
|
return null;
|
||
|
}
|
||
|
return this.dict.Values.GetEnumerator().Current;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
[ProtoContract]
|
||
|
public partial class SkillUpConfig: ProtoObject, IConfig
|
||
|
{
|
||
|
/// <summary>编号</summary>
|
||
|
[ProtoMember(1)]
|
||
|
public int Id { get; set; }
|
||
|
/// <summary>技能ID</summary>
|
||
|
[ProtoMember(2)]
|
||
|
public int SkillId { get; set; }
|
||
|
/// <summary>1级解锁</summary>
|
||
|
[ProtoMember(3)]
|
||
|
public int[] Level1UnlockParameter { get; set; }
|
||
|
/// <summary>2级解锁</summary>
|
||
|
[ProtoMember(4)]
|
||
|
public int[] Level2UnlockParameter { get; set; }
|
||
|
/// <summary>3级解锁</summary>
|
||
|
[ProtoMember(5)]
|
||
|
public int[] Level3UnlockParameter { get; set; }
|
||
|
/// <summary>4级解锁</summary>
|
||
|
[ProtoMember(6)]
|
||
|
public int[] Level4UnlockParameter { get; set; }
|
||
|
/// <summary>5级解锁</summary>
|
||
|
[ProtoMember(7)]
|
||
|
public int[] Level5UnlockParameter { get; set; }
|
||
|
/// <summary>6级解锁</summary>
|
||
|
[ProtoMember(8)]
|
||
|
public int[] Level6UnlockParameter { get; set; }
|
||
|
/// <summary>7级解锁</summary>
|
||
|
[ProtoMember(9)]
|
||
|
public int[] Level7UnlockParameter { get; set; }
|
||
|
/// <summary>8级解锁</summary>
|
||
|
[ProtoMember(10)]
|
||
|
public int[] Level8UnlockParameter { get; set; }
|
||
|
/// <summary>9级解锁</summary>
|
||
|
[ProtoMember(11)]
|
||
|
public int[] Level9UnlockParameter { get; set; }
|
||
|
/// <summary>10级解锁</summary>
|
||
|
[ProtoMember(12)]
|
||
|
public int[] Level10UnlockParameter { get; set; }
|
||
|
|
||
|
}
|
||
|
}
|