using MessagePack;
#if GameClient
using GameFramework;
#endif

namespace GameMessage
{
    /// <summary>
    /// 信息请求-比赛联赛设置
    /// </summary>
    [Message(MessageCode.ClubLeagueSetMatchSetRequest)]
    [MessagePackObject]
    public class ClubLeagueSetMatchSetRequest : MessageData
    {
        [Key(0)] public int ClubId;
        [Key(1)] public ClubLeagueMatchSetting MatchSetting;

#if GameClient
        public static ClubLeagueSetMatchSetRequest Create(int clubId)
        {
            ClubLeagueSetMatchSetRequest request = ReferencePool.Acquire<ClubLeagueSetMatchSetRequest>();
            request.ClubId = clubId;
            return request;
        }

        public override void Clear()
        {
            MatchSetting = null;
        }
#endif
    }

    /// <summary>
    /// 信息响应-比赛联赛设置
    /// </summary>
    [Message(MessageCode.ClubLeagueSetMatchSetResponse)]
    [MessagePackObject]
    public class ClubLeagueSetMatchSetResponse : MessageData
    {
        [Key(0)] public int ClubId;
        [Key(1)] public ClubLeagueMatchSetting MatchSetting;
    }

    [MessagePackObject]
    public class ClubLeagueMatchSetting
    {
        /// <summary>
        /// 普通成员显示的桌子数量
        /// </summary>
        [Key(0)] public int VisibleDeskNum;

        /// <summary>
        /// 是否只显示自己俱乐部的桌子
        /// </summary>
        [Key(1)] public bool IsOnlyVisibleMyClub;

        /// <summary>
        /// 重赛限制
        /// </summary>
        [Key(2)] public bool IsReplayRestrictions;

        /// <summary>
        /// 生存任务限制
        /// </summary>
        [Key(3)] public bool IsLiveTaskRestrictions;
    }

    /// <summary>
    /// 获取俱乐部比赛设置 请求
    /// </summary>
    [Message(MessageCode.ClubMatchSettingRequest)]
    [MessagePackObject]
    public class ClubMatchSettingRequest : MessageData
    {
        /// <summary>
        /// 俱乐部Id
        /// </summary>
        [Key(0)] public int ClubId;

#if GameClient
        public static ClubMatchSettingRequest Create(int clubId)
        {
            ClubMatchSettingRequest request = ReferencePool.Acquire<ClubMatchSettingRequest>();
            request.ClubId = clubId;
            return request;
        }
#endif
    }

    /// <summary>
    /// 获取俱乐部比赛设置 响应
    /// </summary>
    [Message(MessageCode.ClubMatchSettingResponse)]
    [MessagePackObject]
    public class ClubMatchSettingResponse : MessageData
    {
        /// <summary>
        /// 俱乐部Id
        /// </summary>
        [Key(0)] public int ClubId;

        /// <summary>
        /// 普通成员显示的桌子数量
        /// </summary>
        [Key(1)] public int VisibleDesk;

        /// <summary>
        /// 是否只显示自己俱乐部的桌子--只有联赛才会能体现出这个设置
        /// 0是显示自己俱乐部的桌子 1不是
        /// </summary>
        /// <returns></returns>
        [Key(2)] public byte IsOnlyVisibleMyClub;

        /// <summary>
        /// 重赛限制  --重赛审核中的用户无法在本联赛任何俱乐部参与比赛 false不限制 true限制 默认不限制
        /// </summary>
        [Key(3)] public bool ReplayRestrictions;
        
        /// <summary>
        /// 生存任务限制
        /// </summary>
        [Key(4)] public bool LiveTaskRestrictions;
    }
}