using System.Collections.Generic;
using MessagePack;
#if GameClient
using GameFramework;
#endif

namespace GameMessage
{
    /// <summary>
    /// 俱乐部玩法数据请求
    /// </summary>
    [Message(MessageCode.ClubDataPlayWayRequest)]
    [MessagePackObject()]
    public class ClubDataPlayWayRequest : MessageData
    {
        /// <summary>
        /// 俱乐部 Id
        /// </summary>
        [Key(0)] public int ClubId;

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

    /// <summary>
    /// 俱乐部玩法数据响应
    /// </summary>
    [Message(MessageCode.ClubDataPlayWayResponse)]
    [MessagePackObject()]
    public class ClubDataPlayWayResponse : MessageData
    {
        /// <summary>
        /// 所属俱乐部 ID
        /// </summary>
        [Key(0)] public int ClubId;

        /// <summary>
        /// 玩法版本号
        /// </summary>
        [Key(1)] public ulong PlayWayVer;

        /// <summary>
        /// 所有玩法数据
        /// </summary>
        [Key(2)] public List<ClubPlayWay> Ways;
    }

    /// <summary>
    /// 俱乐部玩法数据
    /// </summary>
    [MessagePackObject()]
    public class ClubPlayWay
    {
        /// <summary>
        /// 是否已经删除 -已经删除的只给桌子提供桌子规则数据
        /// </summary>
        [Key(0)] public bool IsDel;

        /// <summary>
        /// 玩法唯一码
        /// </summary>
        [Key(1)] public string Weiyima;

        /// <summary>
        /// 玩法所属俱乐部 Id
        /// </summary>
        [Key(2)] public int ClubId;

        /// <summary>
        /// 那个客户端版本创建的
        /// </summary>
        [Key(3)] public int CreateClientVer;

        /// <summary>
        /// 所属游戏的服务器 ID
        /// </summary>
        [Key(4)] public int SerGameId;

        /// <summary>
        /// 玩法规则
        /// </summary>
        [Key(5)] public ClubDeskRule Rule;
    }

    /// <summary>
    /// 俱乐部隐藏玩法请求
    /// </summary>
    [Message(MessageCode.ClubHideWaysRequest)]
    [MessagePackObject()]
    public class ClubHideWaysRequest : MessageData
    {
        /// <summary>
        /// 俱乐部 id
        /// </summary>
        [Key(0)] public int ClubId;

        /// <summary>
        /// 1 设置玩法隐藏  3获取被隐藏的玩法
        /// </summary>
        [Key(1)] public int Type;

        /// <summary>
        /// 设置被隐藏的玩法
        /// </summary>
        [Key(2)] public string[] Ways;

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

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

    /// <summary>
    /// 俱乐部隐藏玩法响应
    /// </summary>
    [Message(MessageCode.ClubHideWaysResponse)]
    [MessagePackObject()]
    public class ClubHideWaysResponse : MessageData
    {
        /// <summary>
        /// 俱乐部 id
        /// </summary>
        [Key(0)] public int ClubId;

        /// <summary>
        /// 1 设置玩法隐藏  3获取被隐藏的玩法
        /// </summary>
        [Key(1)] public int Type;

        /// <summary>
        /// 玩法
        /// </summary>
        [Key(2)] public string[] Ways;

        /// <summary>
        /// 结果码
        /// </summary>
        [Key(3)] public int ResultCode;
    }
}