using MessagePack;
#if GameClient
using GameFramework;
#endif

namespace GameMessage
{
    /// <summary>
    /// 获取联赛权限请求
    /// </summary>
    [Message(MessageCode.ClubLeaguePowerRequest)]
    [MessagePackObject]
    public class ClubLeaguePowerRequest : MessageData
    {
        /// <summary>
        /// 俱乐部id
        /// </summary>
        [Key(0)]
        public int ClubId;

#if GameClient
        public static ClubLeaguePowerRequest Create(int clubId)
        {
            ClubLeaguePowerRequest request = ReferencePool.Acquire<ClubLeaguePowerRequest>();
            request.ClubId = clubId;
            return request;
        }
#endif
    }
    
    /// <summary>
    /// 获取联赛权限响应
    /// </summary>
    [Message(MessageCode.ClubLeaguePowerResponse)]
    [MessagePackObject]
    public class ClubLeaguePowerResponse : MessageData
    {
        /// <summary>
        /// 俱乐部id
        /// </summary>
        [Key(0)]
        public int ClubId;
        
        /// <summary>
        /// 是否可以创建
        /// </summary>
        [Key(1)]
        public bool IsCanCreate;

        /// <summary>
        /// 是否可以加入
        /// </summary>
        [Key(2)]
        public bool IsCanJoin;
    }
    
    /// <summary>
    /// 解锁联赛权限请求
    /// </summary>
    [Message(MessageCode.ClubLeagueUnlockPowerRequest)]
    [MessagePackObject]
    public class ClubLeagueUnlockPowerRequest : MessageData
    {
        /// <summary>
        /// 俱乐部id
        /// </summary>
        [Key(0)]
        public int ClubId;

#if GameClient
        public static ClubLeagueUnlockPowerRequest Create(int clubId)
        {
            ClubLeagueUnlockPowerRequest request = ReferencePool.Acquire<ClubLeagueUnlockPowerRequest>();
            request.ClubId = clubId;
            return request;
        }
#endif
    }
    
    /// <summary>
    /// 解锁联赛权限响应
    /// </summary>
    [Message(MessageCode.ClubLeagueUnlockPowerResponse)]
    [MessagePackObject]
    public class ClubLeagueUnlockPowerResponse : MessageData
    {
        /// <summary>
        /// 俱乐部id
        /// </summary>
        [Key(0)]
        public int ClubId;
        
        [Key(1)]
        public int StatusCode;
        
        [Key(2)]
        public ClubLeaguePowerMessage PowerMessage;
    }

    [MessagePackObject]
    public class ClubLeaguePowerMessage
    {
        /// <summary>
        /// 是否可以创建
        /// </summary>
        [Key(0)]
        public bool IsCanCreate;

        /// <summary>
        /// 是否可以加入
        /// </summary>
        [Key(1)]
        public bool IsCanJoin;
    }
}


