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

namespace GameMessage
{
    /// <summary>
    /// 信息请求 - 获取生存积分列表
    /// </summary>
    [Message(MessageCode.ClubLeagueGetLifeTasksRequest)]
    [MessagePackObject]
    public class ClubLeagueGetLifeTasksRequest : MessageData
    {
        [Key(0)]public int ClubId;

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

    /// <summary>
    /// 信息响应 - 获取生存积分列表
    /// </summary>
    [Message(MessageCode.ClubLeagueGetLifeTasksResponse)]
    [MessagePackObject]
    public class ClubLeagueGetLifeTasksResponse : MessageData
    {
        [Key(0)]public int ClubId;
        [Key(1)]public List<ClubLiveTaskInfo> List;
    }
    
    /// <summary>
    /// 信息请求 - 发布生存积分列表
    /// </summary>
    [Message(MessageCode.ClubLeaguePublishLiveTaskRequest)]
    [MessagePackObject]
    public class ClubLeaguePublishLiveTaskRequest : MessageData
    {
        [Key(0)]public int ClubId;
        [Key(1)]public List<ClubLiveTaskInfo> List;

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

        public override void Clear()
        {
            List = null;
        }
#endif
    }
    
    
    /// <summary>
    /// 信息请求 - 发布生存积分列表
    /// </summary>
    [Message(MessageCode.ClubLeaguePublishLiveTaskResponse)]
    [MessagePackObject]
    public class ClubLeaguePublishLiveTaskResponse : MessageData
    {
        [Key(0)]public int ClubId;
        [Key(1)]public string ErrorMsg;
    }

    [MessagePackObject]
    public class ClubLiveTaskInfo
    {
        [Key(0)]public int ClubId;
        /// <summary>
        /// 生存积分
        /// </summary>
        [Key(1)]public int Score;
        /// <summary>
        /// 默认的生存积分
        /// </summary>
        [Key(2)]public int DefaultScore;
        [Key(3)]public string ClubName;
        /// <summary>
        /// 是否生效
        /// </summary>
        [Key(4)]public bool IsActive;
        /// <summary>
        /// 玩家总积分+桌费
        /// </summary>
        [Key(5)]public double SumScore;
    }
}