using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FObjBase;
using FLY.Thick.Base.Common;
using Misc;

namespace FLY.Thick.Base.OBJ_INTERFACE
{
    public class BOLTMAPEASY_OBJ_INTERFACE
    {
        public const UInt32 ID = OBJ_INTERFACE_ID.BOLTMAP_ID;
        #region Pack
        public class Pack_Params : IPack 
        {
            public int boltwidth;
            public int boltcnt;
            public BORDER_TYPE bordertype;
            public int borderboltno_b;
            public int smooth;
            #region IPack 成员

            public byte[] ToBytes()
            {
                List<byte> buf = new List<byte>();

                buf.AddRange(BitConverter.GetBytes(boltwidth));
                buf.AddRange(BitConverter.GetBytes(boltcnt));
                buf.AddRange(BitConverter.GetBytes((int)bordertype));
                buf.AddRange(BitConverter.GetBytes(borderboltno_b));
                buf.AddRange(BitConverter.GetBytes(smooth));
                return buf.ToArray();
            }

            public bool TryParse(byte[] value)
            {
                if (value.Length < 4*5)
                    return false;
                int idx = 0;
                boltwidth = BitConverter.ToInt32(value, idx);
                idx += 4;
                boltcnt = BitConverter.ToInt32(value, idx);
                idx += 4;
                bordertype = (BORDER_TYPE)BitConverter.ToInt32(value, idx);
                idx += 4;
                borderboltno_b = BitConverter.ToInt32(value, idx);
                idx += 4;
                smooth = BitConverter.ToInt32(value, idx);
                idx += 4;
                return true;
            }

            #endregion
        }
        #endregion

        #region GetValue
        /// <summary>
        /// Pack_Params
        /// </summary>
        public const UInt16 GET_PARAMS = 0;


        #endregion
        #region SetValue
        /// <summary>
        /// Pack_Params
        /// </summary>
        public const UInt16 SET_PARAMS = 0;

        #endregion
        #region PushMsg
        /// <summary>
        /// Pack_Params
        /// </summary>
        public const UInt16 PUSH_PARAMS = 0;

        #endregion
    }
}
