using System;
using System.Collections.Generic;
using MessagePack;

namespace GameMessage
{
    [Message(MessageCode.PlayerPropertyRequest)]
    [MessagePackObject()]
    public class PlayerPropertyRequest : MessageData
    {
#if GameClient
        public static PlayerPropertyRequest Create()
        {
            return GameFramework.ReferencePool.Acquire<PlayerPropertyRequest>();
        }
#endif
    }

    [Message(MessageCode.PlayerPropertyResponse)]
    [MessagePackObject()]
    public class PlayerPropertyResponse : MessageData
    {
        /// <summary>
        /// 资产变更数据
        /// </summary>
        [Key(0)] public List<PlayerPropertyPack> List;
    }
    
    [Message(MessageCode.PlayerAwardNotify)]
    [MessagePackObject()]
    public class PlayerAwardNotify : MessageData
    {
        /// <summary>
        /// 资产变更数据
        /// </summary>
        [Key(0)] public List<PlayerPropertyPack> List;
        /// <summary>
        /// 变更客户端展示类型
        /// </summary>
        [Key(1)] public PlayerPropertyNotifyUIType NotifyType;
    }

    [MessagePackObject()]
    [Serializable]
    public class PlayerPropertyPack
    {
        /// <summary>
        /// 资产Id （对应 ProductionConfig Id）
        /// </summary>
        [Key(0)] public int Id;

        /// <summary>
        /// 总额
        /// </summary>
        [Key(1)] public long Total;

        /// <summary>
        /// 修改资产的备注
        /// </summary>
        [Key(2)] public string LogTag;
    }
    
    /// <summary>
    /// 变更客户端展示类型
    /// </summary>
    public enum PlayerPropertyNotifyUIType
    {
        /// <summary>
        /// 无展示
        /// </summary>
        None = 0,
        /// <summary>
        /// 奖励弹窗展示
        /// </summary>
        AwardDialog = 1,
        /// <summary>
        /// 兑换商城
        /// </summary>
        ExchangeMall = 2,
    }
}