/*
 * 由SharpDevelop创建。
 * 用户： Administrator
 * 日期: 2018-11-28
 * 时间: 15:34
 * 
 * 要改变这种模板请点击 工具|选项|代码编写|编辑标准头文件
 */
using System;

namespace zyxAdapter {
    /// <summary>
    /// 宿主单元  c#持有调用  c# 调用 dephi使用
    /// </summary>
    public interface IHostUtil {
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="exepath">程序路径</param>
        /// <param name="exename">程序名称</param>
        /// <param name="gameid">游戏id</param>
        /// <returns></returns>
        int Init(string exepath, string exename, int gameid);

        /// <summary>
        /// 释放dll
        /// </summary>
        void FreeDll();

        /// <summary>
        /// 创建厅信息
        /// </summary>
        /// <param name="tingid">厅id</param>
        void CreateTing(int tingCnt, int defaultDeskCnt);

        /// <summary>
        /// 创建桌子
        /// </summary>
        /// <param name="deskid">创建一个桌子</param>
        void CreateDesk(int tingid, int deskid);

        /// <summary>
        /// 摧毁桌子
        /// </summary>
        /// <param name="deskid">桌子的id</param>
        void DestroyDesk(int tingid, int deskid);

        /// <summary>
        /// 加载内存数据-朋友房恢复数据
        /// </summary>
        /// <param name="data"></param>
        void LoadMem(int tingid, int deskid, byte[] data,bool isOld);

        /// <summary>
        /// 开战
        /// </summary>
        /// <param name="deskid">开战的桌子</param>
        void StartWar(int tingid, int deskid);

        /// <summary>
        /// 重连
        /// </summary>
        /// <param name="deskid">重连的桌子</param>
        /// <param name="plid">玩家的id</param>
        void Reconnect(int tingid, int deskid, int plid);

        /// <summary>
        /// 收包
        /// </summary>
        /// <param name="tingid">厅id</param>
        /// <param name="deskid">桌子id</param>
        /// <param name="seat">座位</param>
        /// <param name="intPtr">收的包内容指针</param>
        /// <param name="length">包内容长度</param>
        void Dopack(int tingid, int deskid, int seat,IntPtr intPtr,int length);

        /// <summary>
        /// 定时器
        /// </summary>
        /// <param name="deskid">桌子id</param>
        /// <param name="interval">定时器的间隔</param>
        void DoTimer(int tingid, int deskid, int interval);

        /// <summary>
        /// 调用子游戏方法
        /// </summary>
        /// <param name="tingid">厅id</param>
        /// <param name="deskid">桌子id</param>
        /// <param name="what">方法标识</param>
        /// <param name="param">参数</param>
        /// <returns></returns>
        int doZyxFun(int tingid, int deskid, string what, string param);

        /// <summary>
        /// 测试数据
        /// </summary>
        /// <param name="data">数据</param>
        /// <param name="len">长度</param>
        void DoTest(int data, int len);

    }
}
