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 SkillBuffConfigCategory : ProtoObject, IMerge |
|
{ |
|
public static SkillBuffConfigCategory Instance; |
|
|
|
[ProtoIgnore] |
|
[BsonIgnore] |
|
private Dictionary<int, SkillBuffConfig> dict = new Dictionary<int, SkillBuffConfig>(); |
|
|
|
[BsonElement] |
|
[ProtoMember(1)] |
|
private List<SkillBuffConfig> list = new List<SkillBuffConfig>(); |
|
|
|
public SkillBuffConfigCategory() |
|
{ |
|
Instance = this; |
|
} |
|
|
|
public void Merge(object o) |
|
{ |
|
SkillBuffConfigCategory s = o as SkillBuffConfigCategory; |
|
this.list.AddRange(s.list); |
|
} |
|
|
|
public override void EndInit() |
|
{ |
|
foreach (SkillBuffConfig config in list) |
|
{ |
|
config.EndInit(); |
|
this.dict.Add(config.Id, config); |
|
} |
|
this.AfterEndInit(); |
|
} |
|
|
|
public SkillBuffConfig Get(int id) |
|
{ |
|
this.dict.TryGetValue(id, out SkillBuffConfig item); |
|
|
|
if (item == null) |
|
{ |
|
throw new Exception($"配置找不到,配置表名: {nameof (SkillBuffConfig)},配置id: {id}"); |
|
} |
|
|
|
return item; |
|
} |
|
|
|
public bool Contain(int id) |
|
{ |
|
return this.dict.ContainsKey(id); |
|
} |
|
|
|
public Dictionary<int, SkillBuffConfig> GetAll() |
|
{ |
|
return this.dict; |
|
} |
|
|
|
public List<SkillBuffConfig> GetList() |
|
{ |
|
return this.list; |
|
} |
|
|
|
public SkillBuffConfig GetOne() |
|
{ |
|
if (this.dict == null || this.dict.Count <= 0) |
|
{ |
|
return null; |
|
} |
|
return this.dict.Values.GetEnumerator().Current; |
|
} |
|
} |
|
|
|
[ProtoContract] |
|
public partial class SkillBuffConfig: 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 TriggerEvent { get; set; } |
|
/// <summary>触发参数</summary> |
|
[ProtoMember(4)] |
|
public int TriggerParameter { get; set; } |
|
/// <summary>目标类型</summary> |
|
[ProtoMember(5)] |
|
public int ObjectType { get; set; } |
|
/// <summary>范围类型</summary> |
|
[ProtoMember(6)] |
|
public int ScopeType { get; set; } |
|
/// <summary>冷却类型</summary> |
|
[ProtoMember(7)] |
|
public int CDType { get; set; } |
|
/// <summary>冷却参数</summary> |
|
[ProtoMember(8)] |
|
public int CDParameter { get; set; } |
|
/// <summary>增益性</summary> |
|
[ProtoMember(9)] |
|
public int Gain { get; set; } |
|
/// <summary>可被驱散</summary> |
|
[ProtoMember(10)] |
|
public int Disperse { get; set; } |
|
/// <summary>持续类型</summary> |
|
[ProtoMember(11)] |
|
public int ContinuedType { get; set; } |
|
/// <summary>持续参数</summary> |
|
[ProtoMember(12)] |
|
public int ContinuedParameter { get; set; } |
|
/// <summary>BUFF概率</summary> |
|
[ProtoMember(13)] |
|
public int BuffProbability { get; set; } |
|
/// <summary>关联效果</summary> |
|
[ProtoMember(14)] |
|
public int[] LinkEffect { get; set; } |
|
/// <summary>生效触发</summary> |
|
[ProtoMember(15)] |
|
public int[] StartTrigger { get; set; } |
|
/// <summary>消失触发</summary> |
|
[ProtoMember(16)] |
|
public int EndTrigger { get; set; } |
|
/// <summary>是否叠加</summary> |
|
[ProtoMember(17)] |
|
public int Overlay { get; set; } |
|
/// <summary>最大叠加</summary> |
|
[ProtoMember(18)] |
|
public int OverlayMax { get; set; } |
|
/// <summary>图标</summary> |
|
[ProtoMember(19)] |
|
public string Icon { get; set; } |
|
/// <summary>战斗显示</summary> |
|
[ProtoMember(20)] |
|
public int BattleShow { get; set; } |
|
/// <summary>描述</summary> |
|
[ProtoMember(21)] |
|
public string Describe { get; set; } |
|
|
|
} |
|
}
|
|
|