// Generate By EToy
// Don't Edit It!!

using XGame.Framework.Database;
using XGame.Framework.Serialization;

namespace XGame.Database
{
    /// <summary> EquipmentPeculiarAttr </summary>
    public sealed class EquipmentPeculiarAttrTable : ITable
    {
        long ITable.Key => Id;

        /// <summary> id </summary>
        public int Id { get; private set; }

        /// <summary> 装备品质1：白2：绿3：蓝4：紫5：黄6：橙7：红8：粉9：彩10：鎏金11：璀璨 </summary>
        public EQualityLevel Quality { get; private set; }

        /// <summary> 特殊属性条目数 </summary>
        public int Num { get; private set; }

        /// <summary> 暴击(万分比)[下限值，上限值] </summary>
        public int[] Crit { get; private set; }

        /// <summary> 权重 </summary>
        public int CritRate { get; private set; }

        /// <summary> 连击(万分比) </summary>
        public int[] DoubleHit { get; private set; }

        /// <summary> 权重 </summary>
        public int DoubleHitRate { get; private set; }

        /// <summary> 反击(万分比) </summary>
        public int[] Counter { get; private set; }

        /// <summary> 权重 </summary>
        public int CounterRate { get; private set; }

        /// <summary> 击晕(万分比) </summary>
        public int[] Verti { get; private set; }

        /// <summary> 权重 </summary>
        public int VertiRate { get; private set; }

        /// <summary> 闪避(万分比) </summary>
        public int[] Eva { get; private set; }

        /// <summary> 权重 </summary>
        public int EvaRate { get; private set; }

        /// <summary> 回复(万分比) </summary>
        public int[] HpRec { get; private set; }

        /// <summary> 权重 </summary>
        public int HpRecRate { get; private set; }

        /// <summary> 暴击抵抗(万分比) </summary>
        public int[] CritRes { get; private set; }

        /// <summary> 权重 </summary>
        public int CritResRate { get; private set; }

        /// <summary> 击晕抵抗(万分比) </summary>
        public int[] VertigoRes { get; private set; }

        /// <summary> 权重 </summary>
        public int VertigoResRate { get; private set; }

        /// <summary> 闪避抵抗(万分比) </summary>
        public int[] EvaRes { get; private set; }

        /// <summary> 权重 </summary>
        public int EvaResRate { get; private set; }

        /// <summary> 连击抵抗(万分比) </summary>
        public int[] DoubleHitRes { get; private set; }

        /// <summary> 权重 </summary>
        public int DoubleHitResRate { get; private set; }

        /// <summary> 反击抵抗(万分比) </summary>
        public int[] CounterRes { get; private set; }

        /// <summary> 权重 </summary>
        public int CounterResRate { get; private set; }

        void ISerializable.Deserialize(IReader reader)
        {
            Id = reader.ReadInt();
            Quality = (EQualityLevel)reader.ReadInt();
            Num = reader.ReadInt();
            Crit = reader.ReadEnumerable<int[]>();
            CritRate = reader.ReadInt();
            DoubleHit = reader.ReadEnumerable<int[]>();
            DoubleHitRate = reader.ReadInt();
            Counter = reader.ReadEnumerable<int[]>();
            CounterRate = reader.ReadInt();
            Verti = reader.ReadEnumerable<int[]>();
            VertiRate = reader.ReadInt();
            Eva = reader.ReadEnumerable<int[]>();
            EvaRate = reader.ReadInt();
            HpRec = reader.ReadEnumerable<int[]>();
            HpRecRate = reader.ReadInt();
            CritRes = reader.ReadEnumerable<int[]>();
            CritResRate = reader.ReadInt();
            VertigoRes = reader.ReadEnumerable<int[]>();
            VertigoResRate = reader.ReadInt();
            EvaRes = reader.ReadEnumerable<int[]>();
            EvaResRate = reader.ReadInt();
            DoubleHitRes = reader.ReadEnumerable<int[]>();
            DoubleHitResRate = reader.ReadInt();
            CounterRes = reader.ReadEnumerable<int[]>();
            CounterResRate = reader.ReadInt();
        }

        void ISerializable.Serialize(IWriter writer)
        {
            writer.Write(Id);
            writer.Write((int)Quality);
            writer.Write(Num);
            writer.Write(Crit);
            writer.Write(CritRate);
            writer.Write(DoubleHit);
            writer.Write(DoubleHitRate);
            writer.Write(Counter);
            writer.Write(CounterRate);
            writer.Write(Verti);
            writer.Write(VertiRate);
            writer.Write(Eva);
            writer.Write(EvaRate);
            writer.Write(HpRec);
            writer.Write(HpRecRate);
            writer.Write(CritRes);
            writer.Write(CritResRate);
            writer.Write(VertigoRes);
            writer.Write(VertigoResRate);
            writer.Write(EvaRes);
            writer.Write(EvaResRate);
            writer.Write(DoubleHitRes);
            writer.Write(DoubleHitResRate);
            writer.Write(CounterRes);
            writer.Write(CounterResRate);
        }
    }
}
