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
{

    public class TDGageService : FObj, ITDGageService
    {
        UInt32 mServerID;
        IFConn mConn;


        public TDGageService()
        {
            mServerID = TDGAGE_OBJ_INTERFACE.ID;

        }
        public void StartP1() 
        {
            CurrObjSys.CallFunctionEx(
                mConn, mServerID, ID, 
                TDGAGE_OBJ_INTERFACE.CALL_StartP1,
                null);
        }
        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());       
        }
        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 成员

        public override void ConnectNotify(IFConn from)
        {
            mConn = from;
        }
        #endregion
    }
}
