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


namespace GameMessage
{
    [Message(MessageCode.ClubMatchUserScoreNotesRequest)]
    [MessagePackObject]
    public class ClubMatchUserScoreNotesRequest: MessageData
    {
        
    }
    
    
    /// <summary>
    /// 比赛玩家积分请求
    /// </summary>
    [Message(MessageCode.ClubMatchUserScoresRequest)]
    [MessagePackObject]
    public class ClubMatchUserScoresRequest: MessageData
    {
        [Key(0)] public int ClubId;
        [Key(1)] public DataPage Page;
        [Key(2)] public int MatchId;
        [Key(3)] public bool IsFilter0;
        
#if GameClient
        public static ClubMatchUserScoresRequest Create(int clubId, DataPage page, int matchId, bool isFilter0)
        {
            ClubMatchUserScoresRequest request = ReferencePool.Acquire<ClubMatchUserScoresRequest>();
            request.ClubId = clubId;
            request.Page = page;
            request.MatchId = matchId;
            request.IsFilter0 = isFilter0;
            return request;
        }
#endif
    }


    /// <summary>
    /// 比赛玩家积分响应
    /// </summary>
    [Message(MessageCode.ClubMatchUserScoresResponse)]
    [MessagePackObject]
    public class ClubMatchUserScoresResponse : MessageData
    {
        /// <summary>
        /// 俱乐部ID
        /// </summary>
        [Key(0)] public int ClubId;
        
        
        /// <summary>
        /// 总数
        /// </summary>
        [Key(1)] public int Count;
        [Key(2)] public int PageIndex;
        [Key(3)] public decimal SumScore;
        [Key(4)] public decimal SumDeskScore;
        
        /// <summary>
        /// 玩家的分数
        /// </summary>
        [Key(5)] public List<ClubMatchUserScorePack> List;
    }

    /// <summary>
    /// 比赛玩家积分搜索请求
    /// </summary>
    [Message(MessageCode.ClubMatchUserScoreSearchRequest)]
    [MessagePackObject]    
    public class ClubMatchUserScoreSearchRequest : MessageData
    {
        /// <summary>
        /// 俱乐部ID
        /// </summary>
        [Key(0)] public int ClubId;
        [Key(1)] public int MatchId;
        [Key(2)] public string Search;
        
#if GameClient
        public static ClubMatchUserScoreSearchRequest Create(int clubId, int matchId, string search)
        {
            ClubMatchUserScoreSearchRequest request = ReferencePool.Acquire<ClubMatchUserScoreSearchRequest>();
            request.ClubId = clubId;
            request.Search = search;
            request.MatchId = matchId;
            return request;
        }
#endif
    }
    
    /// <summary>
    /// 玩家积分搜索响应
    /// </summary>
    [Message(MessageCode.ClubMatchUserScoreSearchResponse)]
    [MessagePackObject]
    public class ClubMatchUserScoreSearchResponse : MessageData
    { 
        [Key(0)] public int ClubId;
        [Key(1)] public List<ClubMatchUserScorePack> List;
    }
    
    [MessagePackObject]
    public class ClubMatchUserScorePack
    {
        /// <summary>
        /// 比赛分
        /// </summary>
        [Key(0)] public decimal Score;

        /// <summary>
        /// 玩家提供的桌费  竞技赛活跃积分  房费/人数
        /// 退赛列表界面该字段无效
        /// </summary>
        [Key(1)] public decimal DeskScore;

        /// <summary>
        /// 比赛分备注
        /// </summary>
        [Key(2)] public int ScoreMemo;
        
        [Key(3)] public ClubPlayerSampleInfo PlayerInfo;
    }
}