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

namespace GameMessage
{
    /// <summary>
    /// 获取游戏排行榜请求
    /// </summary> 
    [Message(MessageCode.GetGameRankingRequest)]
    [MessagePackObject()]
    public class GetGameRankingRequest : MessageData
    {
        /// <summary>
        /// 天 -如果请求年和月的数据，这个字段不用赋值
        /// </summary>
        [Key(0)]
        public int Day;

        /// <summary>
        /// 月 -如果请求年的数据，这个字段不用赋值
        /// </summary>
        [Key(1)]
        public int Month;

        /// <summary>
        /// 年
        /// </summary>
        [Key(2)]
        public int Year;

        /// <summary>
        /// 获取第几周的时间
        /// </summary>
        [Key(3)]
        public int WeekDay;

        /// <summary>
        /// 请求排行榜的类型 游戏ID
        /// </summary>
        [Key(4)]
        public int Type;

#if GameClient
        public static GetGameRankingRequest Create()
        {
            GetGameRankingRequest request = ReferencePool.Acquire<GetGameRankingRequest>();
            return request;
        }

        public override void Clear()
        {
            Day = 0;
            Month = 0;
            Year = 0;
            WeekDay = 0;
            Type = 0;
        }
#endif
    }

    /// <summary>
    /// 获取游戏排行榜响应
    /// </summary>
    [Message(MessageCode.GetGameRankingResponse)]
    [MessagePackObject()]
    public class GetGameRankingResponse : MessageData
    {
        /// <summary>
        /// 排行榜的类型 游戏ID
        /// </summary>
        [Key(0)]
        public int Type;

        /// <summary>
        /// 榜单
        /// </summary>
        [Key(1)]
        public List<PlayerInfoOfRanking> List;
    }

    [MessagePackObject()]
    public class PlayerInfoOfRanking
    {
        /// <summary>
        /// 名次
        /// </summary>
        [Key(0)]
        public int Index;

        /// <summary>
        /// 昵称
        /// </summary>
        [Key(1)]
        public string NickName;

        /// <summary>
        /// 数值
        /// </summary>
        [Key(2)]
        public long Number;

        [Key(3)]
        public int Sex;

        [Key(4)]
        public int userid;

        /// <summary>
        /// CTOR
        /// </summary>
        public PlayerInfoOfRanking()
        {

        }
    }

    /// <summary>
    /// 获取积分奖励列表请求
    /// </summary>
    [Message(MessageCode.GetScoreRewardListRequest)]
    [MessagePackObject]
    public class GetScoreRewardListRequest : MessageData
    {

        [Key(0)]
        public int GameId;

#if GameClient
        public static GetScoreRewardListRequest Create()
        {
            GetScoreRewardListRequest request = ReferencePool.Acquire<GetScoreRewardListRequest>();
            return request;
        }
        public override void Clear()
        {
        }
#endif
    }

    /// <summary>
    /// 获取积分奖励列表响应
    /// </summary>
    [Message(MessageCode.GetScoreRewardListResponse)]
    [MessagePackObject]
    public class GetScoreRewardListResponse : MessageData
    {
        /// <summary>
        /// 积分奖励列表
        /// </summary>
        [Key(0)]
        public List<RewardOfScore> RewardList;  

    }

    [MessagePackObject()]
    public class RewardOfScore
    {
        /// <summary>
        /// 积分
        /// </summary>
        [Key(0)]
        public int Score;

        /// <summary>
        /// 奖励物品
        /// </summary>
        [Key(1)]
        public Dictionary<int, long> RewardItems;

        /// <summary>
        /// 奖励索引
        /// </summary>
        [Key(2)]
        public int RewardIndex;

        /// <summary>
        /// CTOR
        /// </summary>
        public RewardOfScore()
        {

        }
    }


    /// <summary>
    /// 领取积分奖励请求
    /// </summary>
    [Message(MessageCode.ReceiveScoreRewardRequest)]
    [MessagePackObject]
    public class ReceiveScoreRewardRequest : MessageData
    {

        [Key(0)]
        public int UserId;

        [Key(1)]
        public int RewardIndex;

        [Key(2)]
        public int RequiredScore;

        [Key(3)]
        public int GameId;

#if GameClient
        public static ReceiveScoreRewardRequest Create()
        {
            ReceiveScoreRewardRequest request = ReferencePool.Acquire<ReceiveScoreRewardRequest>();
            return request;
        }
        public override void Clear()
        {
            UserId = 0;
            RewardIndex = 0;
            RequiredScore = 0;
        }
#endif

    }

    /// <summary>
    /// 领取积分奖励响应
    /// </summary>
    [Message(MessageCode.ReceiveScoreRewardResponse)]
    [MessagePackObject]
    public class ReceiveScoreRewardResponse : MessageData
    { 
    }


}