using System;
using Server.Data;
using Server;

namespace Game.Queue
{
    /// <summary>
    /// 排队控制器
    /// </summary>
    public interface IQueueControll
    {

        /// <summary>
        /// 所属厅
        /// </summary>
        TingManager ting {
            get;
        }

        /// <summary>
        /// 最小人数
        /// </summary>
        int MinCnt {
            get;
        }

        /// <summary>
        /// 最大人数
        /// </summary>
        int MaxCnt {
            get;
        }

        /// <summary>
        /// 添加玩家到排队
        /// </summary>
        /// <param name="pl">玩家</param>
        /// <param name="roomid">房间id</param>
        /// <param name="deskid">桌子id</param>
        /// <returns>是否添加成功</returns>
        bool AddPlayer(PlayerDataAsyc pl, int roomid, int deskid = -1);

        /// <summary>
        /// 处理排队
        /// </summary>
        void DoQueue();

        /// <summary>
        /// 某玩家取消排队
        /// </summary>
        /// <param name="pl">玩家</param>
        /// <returns>是否取消成功</returns>
        bool Cancel(PlayerDataAsyc pl);
    }
}
