using System.Collections.Generic;
using MessagePack;

#if GameClient
using GameFramework;
#endif

namespace GameMessage
{
    /// <summary>
    /// 俱乐部获取我的记录数据请求消息
    /// </summary>
    [Message(MessageCode.ClubGetMyRecordDataRequest)]
    [MessagePackObject]
    public class ClubGetMyRecordDataRequest : MessageData
    {
        /// <summary>
        /// 俱乐部ID
        /// </summary>
        [Key(0)] public int ClubId;

        /// <summary>
        /// 日期
        /// </summary>
        [Key(1)] public long Day;

        /// <summary>
        /// 日期结束
        /// </summary>
        [Key(2)] public long DayEnd;

#if GameClient
        public static ClubGetMyRecordDataRequest Create(int clubId,long day)
        {
            ClubGetMyRecordDataRequest request = ReferencePool.Acquire<ClubGetMyRecordDataRequest>();
            request.ClubId = clubId;
            request.Day = day;
            return request;
        }

        public override void Clear()
        {
            DayEnd = 0;
        }
#endif
    }

    /// <summary>
    /// 俱乐部获取我的记录数据响应消息
    /// </summary>
    [Message(MessageCode.ClubGetMyRecordDataResponse)]
    [MessagePackObject]
    public class ClubGetMyRecordDataResponse : MessageData
    {
        /// <summary>
        /// 俱乐部ID
        /// </summary>
        [Key(0)] public int ClubId;

        /// <summary>
        /// 日期
        /// </summary>
        [Key(1)] public long Day;

        [Key(2)] public MyRecordData Data;
    }

    [MessagePackObject]
    public class MyRecordData
    {
        /// <summary>
        /// 把数
        /// </summary>
        [Key(0)] public int RoundCount;

        /// <summary>
        /// 消耗卡数
        /// </summary>
        [Key(1)] public double CountOfUsedCard;

        /// <summary>
        /// 赢家次数
        /// </summary>
        [Key(2)] public int CountOfBest;

        /// <summary>
        /// 房主次数
        /// </summary>
        [Key(3)] public int CountOfRoomOwner;

        /// <summary>
        /// 请求哪个的数据，直接把客户端发包的日期赋值过来
        /// </summary>
        [Key(4)] public long RequestDay;

        /// <summary>
        /// 请求哪个的数据，直接把客户端发包的日期赋值过来
        /// </summary>
        [Key(5)] public long RequestDayEnd;
    }
}