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

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

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

        /// <summary> 怪物ID </summary>
        public int Id { get; private set; } // sc

        /// <summary> 怪物类型1：普通怪物2：BOSS </summary>
        public int Type { get; private set; } // c

        /// <summary> 名称 </summary>
        public string Name { get; private set; } // c

        /// <summary> 头像 </summary>
        public string Heat { get; private set; } // c

        /// <summary> 怪物属性 </summary>
        public int Attr { get; private set; } // sc

        /// <summary> 怪物技能 </summary>
        public int[] Skills { get; private set; } // sc

        /// <summary> 模型 </summary>
        public string Model { get; private set; } // c

        /// <summary> 模型大小 </summary>
        public float ModelSize { get; private set; } // c

        /// <summary> 攻击力 </summary>
        public int Atk { get; private set; }

        /// <summary> 攻击范围 </summary>
        public float AtkRange { get; private set; }

        /// <summary> 血量 </summary>
        public int Hp { get; private set; }

        /// <summary> 移动速度 </summary>
        public float Speed { get; private set; }

        void ISerializable.Deserialize(IReader reader)
        {
            Id = reader.ReadInt();
            Type = reader.ReadInt();
            Name = reader.ReadString();
            Heat = reader.ReadString();
            Attr = reader.ReadInt();
            Skills = reader.ReadEnumerable<int[]>();
            Model = reader.ReadString();
            ModelSize = reader.ReadFloat();
            Atk = reader.ReadInt();
            AtkRange = reader.ReadFloat();
            Hp = reader.ReadInt();
            Speed = reader.ReadFloat();
        }

        void ISerializable.Serialize(IWriter writer)
        {
            writer.Write(Id);
            writer.Write(Type);
            writer.Write(Name);
            writer.Write(Heat);
            writer.Write(Attr);
            writer.Write(Skills);
            writer.Write(Model);
            writer.Write(ModelSize);
            writer.Write(Atk);
            writer.Write(AtkRange);
            writer.Write(Hp);
            writer.Write(Speed);
        }
    }
}
