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

namespace GameMessage
{
    [Message(MessageCode.AllClubBasicInfoRequest)]
    [MessagePackObject]
    public class AllClubBasicInfoRequest : MessageData
    {
        [Key(0)] public string GetDataTag;

#if GameClient
        public static AllClubBasicInfoRequest Create(string dataTag)
        {
            AllClubBasicInfoRequest request = ReferencePool.Acquire<AllClubBasicInfoRequest>();
            request.GetDataTag = dataTag;
            return request;
        }

        public override void Clear()
        {
            GetDataTag = null;
        }
#endif
    }

    [Message(MessageCode.AllClubBasicInfoResponse)]
    [MessagePackObject]
    public class AllClubBasicInfoResponse : MessageData
    {
        [Key(0)] public int UserId;

        [Key(1)] public List<ClubBasicInfo> ClubBasicInfos;

        /// <summary>
        /// 获取数据标识
        /// </summary>
        [Key(2)] public string GetDataTag;
    }

    [Message(MessageCode.UpdateClubBasicInfoResponse)]
    [MessagePackObject]
    public class UpdateClubBasicInfoResponse : MessageData
    {
        [Key(0)] public ClubBasicInfo ClubBasicInfo;
    }

    [MessagePackObject]
    public class ClubBasicInfo
    {
        /// <summary>
        /// 基础版本
        /// </summary>
        [Key(0)] public ulong BasicVer;

        /// <summary>
        /// 桌子版本
        /// </summary>
        [Key(1)] public ulong DeskVer;

        /// <summary>
        /// 工会ID
        /// </summary>
        [Key(2)] public int Id;

        /// <summary>
        /// 工会名称
        /// </summary>
        [Key(3)] public string ClubName;

        /// <summary>
        /// 会长名称
        /// </summary>
        [Key(4)] public string LeaderName;

        /// <summary>
        /// 会长Userid
        /// </summary>
        [Key(5)] public int LeaderUserId;

        /// <summary>
        /// 工会公告
        /// </summary>
        [Key(6)] public string Notice;

        /// <summary>
        /// 房卡数量
        /// </summary>
        [Key(7)] public int Card;

        /// <summary>
        /// 玩家数量
        /// </summary>
        [Key(8)] public int ManCnt;

        /// <summary>
        /// 所有玩家ID
        /// </summary>
        [Key(9)] public List<int> MansId;

        /// <summary>
        /// 创建时间
        /// </summary>
        [Key(10)] public long CreateTime;

        /// <summary>
        /// 密码
        /// </summary>
        [Key(11)] public string PassWord;

        /// <summary>
        /// 联盟ID
        /// </summary>
        [Key(12)] public int LeagueClubId;

        /// <summary>
        /// 联盟名称
        /// </summary>
        [Key(13)] public string LeagueClubName;
        
        /// <summary>
        /// 是否正在注销
        /// </summary>
        [Key(14)] public bool IsDeleting;
        
        /// <summary>
        /// 公会设置
        /// </summary>
        [Key(15)] public ClubSetting Setting;
    }


    /// <summary>
    /// 获取公会普通信息请求
    /// </summary>
    [Message(MessageCode.GetClubNormalInfoRequest)]
    [MessagePackObject]
    public class GetClubNormalInfoRequest : MessageData
    {
        [Key(0)] public int ClubId;

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

    [Message(MessageCode.GetClubNormalInfoResponse)]
    [MessagePackObject]
    public class GetClubNormalInfoResponse : MessageData
    {
        [Key(0)] public int ClubId;
        [Key(1)] public string ClubName;
    }
}