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

namespace FLY.Thick.Base.OBJ_INTERFACE
{
    public class TDGAGE_OBJ_INTERFACE
    {

        #region Pack
        public class Pack_CallStart2 : IPack
        {
            public STARTP2_MODE order;
            public int targetpos;
            #region IPack 成员

            public byte[] ToBytes()
            {
                List<byte> buf = new List<byte>();
                buf.AddRange(BitConverter.GetBytes((int)order));
                buf.AddRange(BitConverter.GetBytes(targetpos));
                return buf.ToArray();
            }

            public bool TryParse(byte[] value)
            {
                if (value.Length < 8)
                    return false;
                int idx = 0;
                
                order = (STARTP2_MODE)BitConverter.ToInt32(value, idx);
                idx+=4;
                targetpos = BitConverter.ToInt32(value, idx);
                idx += 4;
                return true;
            }

            #endregion
        }



        #endregion


        #region CallFunction
        public const UInt16 CALL_StartP1 = 2;
        /// <summary>
        /// Pack_CallStart2
        /// </summary>
        public const UInt16 CALL_StartP2 = 3;
        #endregion

    }
}
