using GameData.Club;
using MessagePack;
#if GameClient
using GameFramework;
#endif

namespace GameMessage
{
    /// <summary>
    /// 俱乐部统计请求消息
    /// </summary>
    [Message(MessageCode.ClubUpdateSettingRequest)]
    [MessagePackObject]
    public class ClubUpdateSettingRequest : MessageData
    {
        /// <summary>
        /// 俱乐部ID
        /// </summary>
        [Key(0)] public int ClubId;
        [Key(1)] public ClubSetting Setting;

#if GameClient
        public static ClubUpdateSettingRequest Create(int cluId, ClubSetting setting)
        {
            ClubUpdateSettingRequest request = ReferencePool.Acquire<ClubUpdateSettingRequest>();
            request.ClubId = cluId;
            request.Setting = setting;
            return request;
        }
#endif
    }

    /// <summary>
    /// 俱乐部统计响应消息
    /// </summary>
    [Message(MessageCode.ClubUpdateSettingResponse)]
    [MessagePackObject]
    public class ClubUpdateSettingResponse : MessageData
    {
        /// <summary>
        /// 俱乐部ID
        /// </summary>
        [Key(0)] public int ClubId;
        [Key(1)] public ClubSetting Setting;
    }
    
    [MessagePackObject]
    public class ClubSetting
    {
        /// <summary>
        /// 未准备踢出设置
        /// </summary>
        [Key(0)] public int ReadyTimeOut = ClubReadyTimeOutConfig.DefaultReadyTimeOutSeconds;
        /// <summary>
        /// 加入桌子模式 0: 优先加入未满房间 1: 优先创建新房间
        /// </summary>
        [Key(1)] public int JoinDeskMode;
    }
}