//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
// Homepage: https://gameframework.cn/
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------
// 此文件由工具自动生成，请勿直接修改。
// 生成时间：2022-01-24 19:34:40.338
//------------------------------------------------------------

using GameFramework;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using UnityEngine;
using UnityGameFramework.Runtime;

namespace MetaClient
{
    /// <summary>
    /// 自定义身体。
    /// </summary>
    public class DRCustomBody : DataRowBase
    {
        private int m_Id = 0;

        /// <summary>
        /// 获取id。
        /// </summary>
        public override int Id
        {
            get
            {
                return m_Id;
            }
        }

        /// <summary>
        /// 获取名称。
        /// </summary>
        public string Name
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取层级。
        /// </summary>
        public int Cengji
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取是否显示。
        /// </summary>
        public int IsActive
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取图片Icon。
        /// </summary>
        public string Icon
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取按钮类型。
        /// </summary>
        public int ButtonStyple
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取是否传输内容。
        /// </summary>
        public int IsSendContent
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取传输对应类型。
        /// </summary>
        public int SendContent
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取接收到的对应数据。
        /// </summary>
        public int Receive
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取对应身体部位。
        /// </summary>
        public int Part
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取是否保持子物体缩放。
        /// </summary>
        public bool IsKeepChildrenScale
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取是否左右一样。
        /// </summary>
        public bool IsMirror
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取缩放最小值。
        /// </summary>
        public float ScaleRangeMin
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取缩放最大值。
        /// </summary>
        public float ScaleRangeMax
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取缩放修改。
        /// </summary>
        public Vector3 ScaleChange
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取位置修改。
        /// </summary>
        public Vector3 PositionChange
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取角度修改。
        /// </summary>
        public Vector3 RotationChange
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取骨骼名称。
        /// </summary>
        public string BoneName
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取对应的图片类别。
        /// </summary>
        public int ParentStyple
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取是否使用变形器。
        /// </summary>
        public bool IsBlend
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取放大变形器。
        /// </summary>
        public string BiggerBlendName
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取变形器默认值。
        /// </summary>
        public float DefaultBlendValue
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取缩小变形器。
        /// </summary>
        public string SmallerBlendName
        {
            get;
            private set;
        }

        public override bool ParseDataRow(string dataRowString, object userData)
        {
            string[] columnStrings = dataRowString.Split(DataTableExtension.DataSplitSeparators);
            for (int i = 0; i < columnStrings.Length; i++)
            {
                columnStrings[i] = columnStrings[i].Trim(DataTableExtension.DataTrimSeparators);
            }

            int index = 0;
            index++;
            m_Id = int.Parse(columnStrings[index++]);
            Name = columnStrings[index++];
            Cengji = int.Parse(columnStrings[index++]);
            IsActive = int.Parse(columnStrings[index++]);
            Icon = columnStrings[index++];
            ButtonStyple = int.Parse(columnStrings[index++]);
            IsSendContent = int.Parse(columnStrings[index++]);
            SendContent = int.Parse(columnStrings[index++]);
            Receive = int.Parse(columnStrings[index++]);
            Part = int.Parse(columnStrings[index++]);
            IsKeepChildrenScale = bool.Parse(columnStrings[index++]);
            IsMirror = bool.Parse(columnStrings[index++]);
            ScaleRangeMin = float.Parse(columnStrings[index++]);
            ScaleRangeMax = float.Parse(columnStrings[index++]);
            ScaleChange = DataTableExtension.ParseVector3(columnStrings[index++]);
            PositionChange = DataTableExtension.ParseVector3(columnStrings[index++]);
            RotationChange = DataTableExtension.ParseVector3(columnStrings[index++]);
            BoneName = columnStrings[index++];
            ParentStyple = int.Parse(columnStrings[index++]);
            IsBlend = bool.Parse(columnStrings[index++]);
            BiggerBlendName = columnStrings[index++];
            DefaultBlendValue = float.Parse(columnStrings[index++]);
            SmallerBlendName = columnStrings[index++];

            GeneratePropertyArray();
            return true;
        }

        public override bool ParseDataRow(byte[] dataRowBytes, int startIndex, int length, object userData)
        {
            using (MemoryStream memoryStream = new MemoryStream(dataRowBytes, startIndex, length, false))
            {
                using (BinaryReader binaryReader = new BinaryReader(memoryStream, Encoding.UTF8))
                {
                    m_Id = binaryReader.Read7BitEncodedInt32();
                    Name = binaryReader.ReadString();
                    Cengji = binaryReader.Read7BitEncodedInt32();
                    IsActive = binaryReader.Read7BitEncodedInt32();
                    Icon = binaryReader.ReadString();
                    ButtonStyple = binaryReader.Read7BitEncodedInt32();
                    IsSendContent = binaryReader.Read7BitEncodedInt32();
                    SendContent = binaryReader.Read7BitEncodedInt32();
                    Receive = binaryReader.Read7BitEncodedInt32();
                    Part = binaryReader.Read7BitEncodedInt32();
                    IsKeepChildrenScale = binaryReader.ReadBoolean();
                    IsMirror = binaryReader.ReadBoolean();
                    ScaleRangeMin = binaryReader.ReadSingle();
                    ScaleRangeMax = binaryReader.ReadSingle();
                    ScaleChange = binaryReader.ReadVector3();
                    PositionChange = binaryReader.ReadVector3();
                    RotationChange = binaryReader.ReadVector3();
                    BoneName = binaryReader.ReadString();
                    ParentStyple = binaryReader.Read7BitEncodedInt32();
                    IsBlend = binaryReader.ReadBoolean();
                    BiggerBlendName = binaryReader.ReadString();
                    DefaultBlendValue = binaryReader.ReadSingle();
                    SmallerBlendName = binaryReader.ReadString();
                }
            }

            GeneratePropertyArray();
            return true;
        }

        private void GeneratePropertyArray()
        {

        }
    }
}
