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.
148 lines
4.0 KiB
148 lines
4.0 KiB
using System; |
|
using System.Collections.Generic; |
|
using MongoDB.Bson.Serialization.Attributes; |
|
using ProtoBuf; |
|
|
|
namespace ET |
|
{ |
|
[ProtoContract] |
|
[Config] |
|
public partial class SkillFatherConfigCategory : ProtoObject, IMerge |
|
{ |
|
public static SkillFatherConfigCategory Instance; |
|
|
|
[ProtoIgnore] |
|
[BsonIgnore] |
|
private Dictionary<int, SkillFatherConfig> dict = new Dictionary<int, SkillFatherConfig>(); |
|
|
|
[BsonElement] |
|
[ProtoMember(1)] |
|
private List<SkillFatherConfig> list = new List<SkillFatherConfig>(); |
|
|
|
public SkillFatherConfigCategory() |
|
{ |
|
Instance = this; |
|
} |
|
|
|
public void Merge(object o) |
|
{ |
|
SkillFatherConfigCategory s = o as SkillFatherConfigCategory; |
|
this.list.AddRange(s.list); |
|
} |
|
|
|
public override void EndInit() |
|
{ |
|
foreach (SkillFatherConfig config in list) |
|
{ |
|
config.EndInit(); |
|
this.dict.Add(config.Id, config); |
|
} |
|
this.AfterEndInit(); |
|
} |
|
|
|
public SkillFatherConfig Get(int id) |
|
{ |
|
this.dict.TryGetValue(id, out SkillFatherConfig item); |
|
|
|
if (item == null) |
|
{ |
|
throw new Exception($"配置找不到,配置表名: {nameof (SkillFatherConfig)},配置id: {id}"); |
|
} |
|
|
|
return item; |
|
} |
|
|
|
public bool Contain(int id) |
|
{ |
|
return this.dict.ContainsKey(id); |
|
} |
|
|
|
public Dictionary<int, SkillFatherConfig> GetAll() |
|
{ |
|
return this.dict; |
|
} |
|
|
|
public List<SkillFatherConfig> GetList() |
|
{ |
|
return this.list; |
|
} |
|
|
|
public SkillFatherConfig GetOne() |
|
{ |
|
if (this.dict == null || this.dict.Count <= 0) |
|
{ |
|
return null; |
|
} |
|
return this.dict.Values.GetEnumerator().Current; |
|
} |
|
} |
|
|
|
[ProtoContract] |
|
public partial class SkillFatherConfig: ProtoObject, IConfig |
|
{ |
|
/// <summary>编号</summary> |
|
[ProtoMember(1)] |
|
public int Id { get; set; } |
|
/// <summary>技能名称</summary> |
|
[ProtoMember(2)] |
|
public string SkillName { get; set; } |
|
/// <summary>武器限制</summary> |
|
[ProtoMember(3)] |
|
public int Weapon { get; set; } |
|
/// <summary>学习等级</summary> |
|
[ProtoMember(4)] |
|
public int LearningLevel { get; set; } |
|
/// <summary>类型</summary> |
|
[ProtoMember(5)] |
|
public int Type { get; set; } |
|
/// <summary>技能类型</summary> |
|
[ProtoMember(6)] |
|
public int SkillType { get; set; } |
|
/// <summary>施放类型</summary> |
|
[ProtoMember(7)] |
|
public int ActionType { get; set; } |
|
/// <summary>可否被沉默</summary> |
|
[ProtoMember(8)] |
|
public int Silence { get; set; } |
|
/// <summary>技能近身性</summary> |
|
[ProtoMember(9)] |
|
public int GetClose { get; set; } |
|
/// <summary>冷却类型</summary> |
|
[ProtoMember(10)] |
|
public int CDType { get; set; } |
|
/// <summary>冷却参数</summary> |
|
[ProtoMember(11)] |
|
public int CDParameter { get; set; } |
|
/// <summary>等级上限</summary> |
|
[ProtoMember(12)] |
|
public int LevelCap { get; set; } |
|
/// <summary>战意消耗</summary> |
|
[ProtoMember(13)] |
|
public int FightingSpiritConsume { get; set; } |
|
/// <summary>属性1</summary> |
|
[ProtoMember(14)] |
|
public int Attribute1 { get; set; } |
|
/// <summary>属性1参数</summary> |
|
[ProtoMember(15)] |
|
public string Attribute1Parameter { get; set; } |
|
/// <summary>属性2</summary> |
|
[ProtoMember(16)] |
|
public int Attribute2 { get; set; } |
|
/// <summary>属性2参数</summary> |
|
[ProtoMember(17)] |
|
public string Attribute2Parameter { get; set; } |
|
/// <summary>子技能组</summary> |
|
[ProtoMember(18)] |
|
public int[] SkillSonGroup { get; set; } |
|
/// <summary>升级组</summary> |
|
[ProtoMember(19)] |
|
public int SkillUp { get; set; } |
|
/// <summary>技能图标</summary> |
|
[ProtoMember(20)] |
|
public string Icon { get; set; } |
|
/// <summary>技能描述</summary> |
|
[ProtoMember(21)] |
|
public string Describe { get; set; } |
|
|
|
} |
|
}
|
|
|