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.
128 lines
3.4 KiB
128 lines
3.4 KiB
3 years ago
|
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 Strength { get; set; }
|
||
|
/// <summary>体魄</summary>
|
||
|
[ProtoMember(5)]
|
||
|
public int Endurance { get; set; }
|
||
|
/// <summary>敏捷</summary>
|
||
|
[ProtoMember(6)]
|
||
|
public int Agile { get; set; }
|
||
|
/// <summary>灵力</summary>
|
||
|
[ProtoMember(7)]
|
||
|
public int SpiritualPower { get; set; }
|
||
|
/// <summary>战意恢复</summary>
|
||
|
[ProtoMember(8)]
|
||
|
public int FSC { get; set; }
|
||
|
/// <summary>使用武器</summary>
|
||
|
[ProtoMember(9)]
|
||
|
public int[] Weapon { get; set; }
|
||
|
/// <summary>天赋技能</summary>
|
||
|
[ProtoMember(10)]
|
||
|
public int Talent { get; set; }
|
||
|
/// <summary>无武器普通攻击</summary>
|
||
|
[ProtoMember(11)]
|
||
|
public int UnarmedAttack { get; set; }
|
||
|
/// <summary>远程近战</summary>
|
||
|
[ProtoMember(12)]
|
||
|
public int Remote { get; set; }
|
||
|
/// <summary>普通攻击</summary>
|
||
|
[ProtoMember(13)]
|
||
|
public int NormalAttack { get; set; }
|
||
|
/// <summary>初始技能</summary>
|
||
|
[ProtoMember(14)]
|
||
|
public int SkillSet { get; set; }
|
||
|
|
||
|
}
|
||
|
}
|