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.
151 lines
4.1 KiB
151 lines
4.1 KiB
using System; |
|
using System.Collections.Generic; |
|
using MongoDB.Bson.Serialization.Attributes; |
|
using ProtoBuf; |
|
|
|
namespace ET |
|
{ |
|
[ProtoContract] |
|
[Config] |
|
public partial class SkillSonConfigCategory : ProtoObject, IMerge |
|
{ |
|
public static SkillSonConfigCategory Instance; |
|
|
|
[ProtoIgnore] |
|
[BsonIgnore] |
|
private Dictionary<int, SkillSonConfig> dict = new Dictionary<int, SkillSonConfig>(); |
|
|
|
[BsonElement] |
|
[ProtoMember(1)] |
|
private List<SkillSonConfig> list = new List<SkillSonConfig>(); |
|
|
|
public SkillSonConfigCategory() |
|
{ |
|
Instance = this; |
|
} |
|
|
|
public void Merge(object o) |
|
{ |
|
SkillSonConfigCategory s = o as SkillSonConfigCategory; |
|
this.list.AddRange(s.list); |
|
} |
|
|
|
public override void EndInit() |
|
{ |
|
foreach (SkillSonConfig config in list) |
|
{ |
|
config.EndInit(); |
|
this.dict.Add(config.Id, config); |
|
} |
|
this.AfterEndInit(); |
|
} |
|
|
|
public SkillSonConfig Get(int id) |
|
{ |
|
this.dict.TryGetValue(id, out SkillSonConfig item); |
|
|
|
if (item == null) |
|
{ |
|
throw new Exception($"配置找不到,配置表名: {nameof (SkillSonConfig)},配置id: {id}"); |
|
} |
|
|
|
return item; |
|
} |
|
|
|
public bool Contain(int id) |
|
{ |
|
return this.dict.ContainsKey(id); |
|
} |
|
|
|
public Dictionary<int, SkillSonConfig> GetAll() |
|
{ |
|
return this.dict; |
|
} |
|
|
|
public List<SkillSonConfig> GetList() |
|
{ |
|
return this.list; |
|
} |
|
|
|
public SkillSonConfig GetOne() |
|
{ |
|
if (this.dict == null || this.dict.Count <= 0) |
|
{ |
|
return null; |
|
} |
|
return this.dict.Values.GetEnumerator().Current; |
|
} |
|
} |
|
|
|
[ProtoContract] |
|
public partial class SkillSonConfig: ProtoObject, IConfig |
|
{ |
|
/// <summary>编号</summary> |
|
[ProtoMember(1)] |
|
public int Id { get; set; } |
|
/// <summary>子技能名称</summary> |
|
[ProtoMember(2)] |
|
public string Name { get; set; } |
|
/// <summary>施放类型</summary> |
|
[ProtoMember(3)] |
|
public int ActionType { get; set; } |
|
/// <summary>目标类型</summary> |
|
[ProtoMember(4)] |
|
public int ObjectType { get; set; } |
|
/// <summary>范围类型</summary> |
|
[ProtoMember(5)] |
|
public int ScopeType { get; set; } |
|
/// <summary>施放位置</summary> |
|
[ProtoMember(6)] |
|
public int CastPosition { get; set; } |
|
/// <summary>是否可暴击</summary> |
|
[ProtoMember(7)] |
|
public int WhetherToCrit { get; set; } |
|
/// <summary>可否被打断</summary> |
|
[ProtoMember(8)] |
|
public int CanBeChase { get; set; } |
|
/// <summary>可否被招架</summary> |
|
[ProtoMember(9)] |
|
public int CanBeParry { get; set; } |
|
/// <summary>可否被反击</summary> |
|
[ProtoMember(10)] |
|
public int CanBeFightBack { get; set; } |
|
/// <summary>可否被追击</summary> |
|
[ProtoMember(11)] |
|
public int CanBeInterrupt { get; set; } |
|
/// <summary>可否被援护</summary> |
|
[ProtoMember(12)] |
|
public int CanBeSupport { get; set; } |
|
/// <summary>直接近战伤害</summary> |
|
[ProtoMember(13)] |
|
public int DirectInjury { get; set; } |
|
/// <summary>触发类型</summary> |
|
[ProtoMember(14)] |
|
public int TriggerType { get; set; } |
|
/// <summary>触发参数</summary> |
|
[ProtoMember(15)] |
|
public int TriggerParameter { get; set; } |
|
/// <summary>关联Buff</summary> |
|
[ProtoMember(16)] |
|
public int[] Buff { get; set; } |
|
/// <summary>关联子技能</summary> |
|
[ProtoMember(17)] |
|
public int[] SkillSon { get; set; } |
|
/// <summary>是否要解锁</summary> |
|
[ProtoMember(18)] |
|
public int Unlock { get; set; } |
|
/// <summary>招式动作</summary> |
|
[ProtoMember(19)] |
|
public string Action { get; set; } |
|
/// <summary>音效</summary> |
|
[ProtoMember(20)] |
|
public string Sound { get; set; } |
|
/// <summary>图标</summary> |
|
[ProtoMember(21)] |
|
public string Icon { get; set; } |
|
/// <summary>描述</summary> |
|
[ProtoMember(22)] |
|
public string Describe { get; set; } |
|
|
|
} |
|
}
|
|
|