using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using FObjBase;
using FLY.Thick.Base.IService;
using FLY.Thick.Base.OBJ_INTERFACE;
using FLY.Thick.Base.Common;
namespace FLY.Thick.Base.Client
{
    /// <summary>
    /// 
    /// </summary>
    public class TDGageServiceClient : FObjServiceClient, ITDGageService
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="serverid"></param>
        public TDGageServiceClient(UInt32 serverid) : base(serverid) { }
        /// <summary>
        ///
        /// </summary>
        /// <param name="serviceId">服务id</param>
        /// <param name="connName">连接器</param>
        public TDGageServiceClient(UInt32 serviceId, string connName) : base(serviceId, connName) { }

        /// <summary>
        /// 
        /// </summary>
        public void StartP1() 
        {
            CurrObjSys.CallFunctionEx(
                mConn, mServerID, ID, 
                TDGAGE_OBJ_INTERFACE.CALL_StartP1,
                null);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="mode"></param>
        public void StartP2(STARTP2_MODE mode)
        {
            CurrObjSys.CallFunctionEx(
              mConn, mServerID, ID,
              TDGAGE_OBJ_INTERFACE.CALL_StartP2,
              new TDGAGE_OBJ_INTERFACE.Pack_CallStart2() { order = mode }.ToBytes());       
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="mode"></param>
        /// <param name="targetpos"></param>
        public void StartP2(STARTP2_MODE mode, int targetpos) 
        {
            CurrObjSys.CallFunctionEx(
              mConn, mServerID, ID, 
              TDGAGE_OBJ_INTERFACE.CALL_StartP2,
              new TDGAGE_OBJ_INTERFACE.Pack_CallStart2() { order = mode, targetpos = targetpos }.ToBytes());          
        }
        #region IFObj 成员

        #endregion
    }
}
