using MessagePack;
#if GameClient
using GameFramework;
#endif

namespace GameMessage
{
    [Message(MessageCode.ClubPartnerEditorRequest)]
    [MessagePackObject()]
    public class ClubPartnerEditorRequest : MessageData
    {
        /// <summary>
        /// 俱乐部Id
        /// </summary>
        [Key(0)] public int ClubId;

        /// <summary>
        /// 玩家UserId
        /// </summary>
        [Key(1)] public int EditorUserId;

        /// <summary>
        /// 0 增 1删
        /// </summary>
        /// <returns></returns>
        [Key(2)] public int EditorType;

#if GameClient
        public static ClubPartnerEditorRequest Create(int clubId,int editorUserId,int editorType)
        {
            ClubPartnerEditorRequest request = ReferencePool.Acquire<ClubPartnerEditorRequest>();
            request.ClubId = clubId;
            request.EditorUserId = editorUserId;
            request.EditorType = editorType;
            return request;
        }
#endif
    }

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

        [Key(1)] public int ClubId;

        [Key(2)] public int EditorUserId;

        [Key(3)] public int EditorType;
    }

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

        [Key(1)] public int PartnerId;

        /// <summary>
        /// 0 添加 1移除 2转移
        /// </summary>
        [Key(2)] public int EditorType;

        /// <summary>
        /// 操作的成员
        /// </summary>
        [Key(3)] public int[] MemberId;

        /// <summary>
        /// 目标合伙人Id
        /// </summary>
        [Key(4)] public int TargetPartnerId;

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

        public override void Clear()
        {
            PartnerId = 0;
            EditorType = 0;
            MemberId = null;
            TargetPartnerId = 0;
        }
#endif
        
    }

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

        /// <summary>
        /// 俱乐部Id
        /// </summary>
        [Key(1)] public int ClubId;

        /// <summary>
        /// 合伙人Id
        /// </summary>
        [Key(2)] public int PartnerId;

        /// <summary>
        /// 0 添加 1移除 2 转移
        /// </summary>
        [Key(3)] public int EditorType;

        /// <summary>
        /// 操作的成员
        /// </summary>
        [Key(4)] public int[] MemberId;

        /// <summary>
        /// 目标合伙人Id
        /// </summary>
        [Key(5)] public int TargetPartnerId;
    }

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

        [Key(1)] public int PartnerId;

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

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

        [Key(1)] public int ClubId;

        [Key(2)] public int PartnerId;
    }
}