using MessagePack;
#if GameClient
using GameFramework;
#endif

namespace GameMessage
{
    [Message(MessageCode.PlayerBasicInfoRequest)]
    [MessagePackObject()]
    public class PlayerBasicInfoRequest : MessageData
    {
        [Key(0)] public int[] Userids;

#if GameClient
        public static PlayerBasicInfoRequest Create()
        {
            return ReferencePool.Acquire<PlayerBasicInfoRequest>();
        }

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

    [Message(MessageCode.PlayerBasicInfoResponse)]
    [MessagePackObject()]
    public class PlayerBasicInfoResponse : MessageData
    {
        [Key(0)] public PlayerBasicInfo[] PlayerInfos;
    }

    [MessagePackObject()]
    public class PlayerBasicInfo
    {
        [Key(0)] public int Userid;

        [Key(1)] public string Avater;

        [Key(2)] public string NickName;
    }

    /// <summary>
    /// 修改玩家头像或者性别请求
    /// </summary>
    [Message(MessageCode.EditorPlayerSexOrPhotoRequest)]
    [MessagePackObject()]
    public class EditorPlayerSexOrPhotoRequest : MessageData
    {
        /// <summary>
        /// 性别 0 男 1 女
        /// </summary>
        [Key(0)]
        public int Sex;

        /// <summary>
        /// 设置头像id
        /// </summary>
        [Key(1)]
        public int HeadId;
        
        #if GameClient
        public static EditorPlayerSexOrPhotoRequest Create(int sex)
        {
            EditorPlayerSexOrPhotoRequest request = ReferencePool.Acquire<EditorPlayerSexOrPhotoRequest>();
            request.Sex = sex;
            return request;
        }

        public override void Clear()
        {
            HeadId = 0;
        }

#endif
    }
    
    /// <summary>
    /// 修改玩家头像或者性别响应
    /// </summary>
    [Message(MessageCode.EditorPlayerSexOrPhotoResponse)]
    [MessagePackObject()]
    public class EditorPlayerSexOrPhotoResponse : MessageData
    {
        
    }
}