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.
130 lines
3.5 KiB
130 lines
3.5 KiB
using System; |
|
using System.Collections.Generic; |
|
using MongoDB.Bson.Serialization.Attributes; |
|
using ProtoBuf; |
|
|
|
namespace ET |
|
{ |
|
[ProtoContract] |
|
[Config] |
|
public partial class AttributesGroupConfigCategory : ProtoObject, IMerge |
|
{ |
|
public static AttributesGroupConfigCategory Instance; |
|
|
|
[ProtoIgnore] |
|
[BsonIgnore] |
|
private Dictionary<int, AttributesGroupConfig> dict = new Dictionary<int, AttributesGroupConfig>(); |
|
|
|
[BsonElement] |
|
[ProtoMember(1)] |
|
private List<AttributesGroupConfig> list = new List<AttributesGroupConfig>(); |
|
|
|
public AttributesGroupConfigCategory() |
|
{ |
|
Instance = this; |
|
} |
|
|
|
public void Merge(object o) |
|
{ |
|
AttributesGroupConfigCategory s = o as AttributesGroupConfigCategory; |
|
this.list.AddRange(s.list); |
|
} |
|
|
|
public override void EndInit() |
|
{ |
|
foreach (AttributesGroupConfig config in list) |
|
{ |
|
config.EndInit(); |
|
this.dict.Add(config.Id, config); |
|
} |
|
this.AfterEndInit(); |
|
} |
|
|
|
public AttributesGroupConfig Get(int id) |
|
{ |
|
this.dict.TryGetValue(id, out AttributesGroupConfig item); |
|
|
|
if (item == null) |
|
{ |
|
throw new Exception($"配置找不到,配置表名: {nameof (AttributesGroupConfig)},配置id: {id}"); |
|
} |
|
|
|
return item; |
|
} |
|
|
|
public bool Contain(int id) |
|
{ |
|
return this.dict.ContainsKey(id); |
|
} |
|
|
|
public Dictionary<int, AttributesGroupConfig> GetAll() |
|
{ |
|
return this.dict; |
|
} |
|
|
|
public List<AttributesGroupConfig> GetList() |
|
{ |
|
return this.list; |
|
} |
|
|
|
public AttributesGroupConfig GetOne() |
|
{ |
|
if (this.dict == null || this.dict.Count <= 0) |
|
{ |
|
return null; |
|
} |
|
return this.dict.Values.GetEnumerator().Current; |
|
} |
|
} |
|
|
|
[ProtoContract] |
|
public partial class AttributesGroupConfig: ProtoObject, IConfig |
|
{ |
|
/// <summary>编号</summary> |
|
[ProtoMember(1)] |
|
public int Id { get; set; } |
|
/// <summary>等级</summary> |
|
[ProtoMember(2)] |
|
public int Lv { get; set; } |
|
/// <summary>统帅力</summary> |
|
[ProtoMember(3)] |
|
public int Domination { get; set; } |
|
/// <summary>初始火抗</summary> |
|
[ProtoMember(4)] |
|
public int StarFireResistance { get; set; } |
|
/// <summary>初始雷抗</summary> |
|
[ProtoMember(5)] |
|
public int StarThunderResistance { get; set; } |
|
/// <summary>初始毒抗</summary> |
|
[ProtoMember(6)] |
|
public int StarPoisonResistance { get; set; } |
|
/// <summary>初始冰抗</summary> |
|
[ProtoMember(7)] |
|
public int StarIceResistance { get; set; } |
|
/// <summary>生命成长</summary> |
|
[ProtoMember(8)] |
|
public int HPGrow { get; set; } |
|
/// <summary>防御成长</summary> |
|
[ProtoMember(9)] |
|
public int DEFGrow { get; set; } |
|
/// <summary>攻击成长</summary> |
|
[ProtoMember(10)] |
|
public int ATKGrow { get; set; } |
|
/// <summary>攻速成长</summary> |
|
[ProtoMember(11)] |
|
public int WSPGrow { get; set; } |
|
/// <summary>能量恢复</summary> |
|
[ProtoMember(12)] |
|
public int MPRecover { get; set; } |
|
/// <summary>使用武器</summary> |
|
[ProtoMember(13)] |
|
public int[] Weapon { get; set; } |
|
/// <summary>天赋技能</summary> |
|
[ProtoMember(14)] |
|
public int Talent { get; set; } |
|
/// <summary>初始技能</summary> |
|
[ProtoMember(15)] |
|
public int SkillSet { get; set; } |
|
|
|
} |
|
}
|
|
|