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

using FObjBase;
using FLY.Thick.Base.OBJ_INTERFACE;
using FLY.Thick.Base.Common;
using FLY.Thick.Base.IService;



namespace FLY.Thick.Base.Server.OBJProxy
{
    public class TDGage_OBJProxy:FObj
    {
        ITDGageService mGage;
        public TDGage_OBJProxy(int objsys_idx, UInt32 id, ITDGageService gage)
            : base(objsys_idx) 
        {
            ID = id;
            mGage = gage;
        }
        #region IFObj 成员

        public override void CallFunction(IFConn from, uint srcid, UInt32 magic, ushort funcid, byte[] infodata)
        {
            switch (funcid)
            {
                case TDGAGE_OBJ_INTERFACE.CALL_StartP1:
                    {
                        mGage.StartP1();
                    } break;
                case TDGAGE_OBJ_INTERFACE.CALL_StartP2:
                    {
                        TDGAGE_OBJ_INTERFACE.Pack_CallStart2 p = new TDGAGE_OBJ_INTERFACE.Pack_CallStart2();
                        if (!p.TryParse(infodata))
                            break;
                        mGage.StartP2(p.order,p.targetpos);
                    } break;
            }
        }
        #endregion
    }
}
