using System;
using MessagePack;
#if GameClient
using GameFramework;
#endif

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

        /// <summary>
        /// 要修改的玩家ID
        /// </summary>
        [Key(1)]
        public int UserId;

        /// <summary>
        /// 是否允许进入游戏
        /// </summary>
        [Key(2)]
        public int InGame;

        /// <summary>
        /// 修改类型
        /// </summary>
        [Key(3)]
        public int EditorType;

        /// <summary>
        /// 备注
        /// </summary>
        [Key(4)]
        public string Remark;

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

        public override void Clear()
        {
            InGame = 0;
            EditorType = 0;
            Remark = null;
        }
#endif
    }
    
    [Message(MessageCode.ClubPlayerEditorResponse)]
    [MessagePackObject]
    public class ClubPlayerEditorResponse : MessageData
    {
        /// <summary>
        /// 结果代码
        /// </summary>
        [Key(0)]
        public int ResultCode;
        
        /// <summary>
        /// 俱乐部ID
        /// </summary>
        [Key(1)]
        public int ClubId;
        
        /// <summary>
        /// 玩家ID
        /// </summary>
        [Key(2)]
        public int UserId;

        /// <summary>
        /// 是否允许进入游戏 0:不允许 1:允许
        /// </summary>
        [Key(3)]
        public int InGame;

        /// <summary>
        /// 编辑类型
        /// </summary>
        [Key(4)]
        public int EditorType;

        /// <summary>
        /// 备注信息
        /// </summary>
        [Key(5)]
        public string Remark;
    }

    [Flags]
    public enum ClubPlayerEditorType
    {
        /// <summary>
        /// 备注
        /// </summary>
        Remark = 1,
        
        /// <summary>
        /// 小黑屋
        /// </summary>
        BlackRoom = 2,
    }
}