using MessagePack;
#if GameClient
using GameFramework;
#endif

namespace GameMessage
{
    /// <summary>
    /// 保险箱操作请求
    /// </summary>
    [Message(MessageCode.SafeBoxOperationRequest)]
    [MessagePackObject()]
    public class SafeBoxOperationRequest : MessageData
    {
        /// <summary>
        /// 请求Id
        /// </summary>
        [Key(0)]
        public int RequestId;

        /// <summary>
        /// 操作类型  1 存  2 取
        /// </summary>
        [Key(1)]
        public int OperationType;

        /// <summary>
        /// 操作值
        /// </summary>
        [Key(2)]
        public int OperationValue;
        
        #if GameClient
        public static SafeBoxOperationRequest Create(int requestId,int operationType,int operationValue)
        {
            SafeBoxOperationRequest request = ReferencePool.Acquire<SafeBoxOperationRequest>();
            request.RequestId = requestId;
            request.OperationType = operationType;
            request.OperationValue = operationValue;
            return request;
        }
#endif
    }
    
    /// <summary>
    /// 保险箱操作响应
    /// </summary>
    [Message(MessageCode.SafeBoxOperationResponse)]
    [MessagePackObject()]
    public class SafeBoxOperationResponse : MessageData
    {
        /// <summary>
        ///请求ID
        /// </summary>
        [Key(0)]
        public int RequestId;

        /// <summary>
        /// 请求结果
        /// </summary>
        [Key(1)]
        public int ResultCode;
        
        [Key(2)]
        public int OperationType;
        
        [Key(3)]
        public int OperationValue;
    }
}