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

namespace GameMessage
{
    [Message(MessageCode.ClubPartnerMembersRequest)]
    [MessagePackObject]
    public class ClubPartnerMembersRequest : MessageData
    {
        [Key(0)] public int ClubId;

        [Key(1)] public int PartnerId;

        [Key(2)] public long Start;

        [Key(3)] public long End;

#if GameClient
        public static ClubPartnerMembersRequest Create(int clubId,int partnerId,long start,long end)
        {
            ClubPartnerMembersRequest request = ReferencePool.Acquire<ClubPartnerMembersRequest>();
            request.ClubId = clubId;
            request.PartnerId = partnerId;
            request.Start = start;
            request.End = end;
            return request;
        }
#endif
    }

    [Message(MessageCode.ClubPartnerMembersResponse)]
    [MessagePackObject]
    public class ClubPartnerMembersResponse : MessageData
    {
        [Key(0)] public int ClubId;
        [Key(1)] public int PartnerId;

        [Key(2)] public List<ClubPartnerMemberInfo> PartnerMemberInfos;
    }

    [Message(MessageCode.ClubNotPartnerSearchRequest)]
    [MessagePackObject]
    public class ClubNotPartnerSearchRequest : MessageData
    {
        [Key(0)] public int ClubId;

        [Key(1)] public string KeyWord;

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

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

    [Message(MessageCode.ClubNotPartnerSearchResponse)]
    [MessagePackObject]
    public class ClubNotPartnerSearchResponse : MessageData
    {
        [Key(0)] public int ClubId;

        [Key(1)] public string KeyWord;

        [Key(2)] public List<ClubPartnerMemberInfo> PartnerMemberInfos;
    }

    [Message(MessageCode.ClubPartnerListGetRequest)]
    [MessagePackObject]
    public class ClubPartnerListGetRequest : MessageData
    {
        [Key(0)] public int ClubId;
    }

    [Message(MessageCode.ClubPartnerListGetResponse)]
    [MessagePackObject]
    public class ClubPartnerListGetResponse : MessageData
    {
        [Key(0)] public int ClubId;

        [Key(1)] public List<ClubPartnerMemberInfo> PartnerMemberInfos;
    }

    [MessagePackObject]
    public class ClubPartnerMemberInfo
    {
        [Key(0)] public int UserId;
        [Key(1)] public int Sex;
        [Key(2)] public string NickName;

        /// <summary>
        /// 0 人数
        /// 1 
        /// 2 大赢家数量
        /// 3 房间数量
        /// 4 耗卡数量
        /// </summary>
        [Key(3)] public int[] Data;
    }
}