#if GameClient
using GameFramework;
#endif

using System;
using MessagePack;

namespace GameMessage
{
    /// <summary>
    /// 福利数据请求
    /// </summary>
    [Message(MessageCode.WelfareDataRequest)]
    [MessagePackObject()]
    [Obsolete("版本50以上过时")]
    public class WelfareDataRequest : MessageData
    {
        #if GameClient
        public static WelfareDataRequest Create()
        {
            return ReferencePool.Acquire<WelfareDataRequest>();
        }
        #endif
    }

    /// <summary>
    /// 福利数据响应
    /// </summary>
    [Message(MessageCode.WelfareDataResponse)]
    [MessagePackObject()]
    [Obsolete("版本50以上过时")]
    public class WelfareDataResponse : MessageData
    {
        /// <summary>
        /// 上次签到的时间
        /// </summary>
        [Key(0)] public string LastSignTimeStr;

        /// <summary>
        /// 连续签到次数
        /// </summary>
        [Key(1)] public int LastSignCnt;
    }
    
    /// <summary>
    /// 救济金请求
    /// </summary>
    [Message(MessageCode.ReliefRequest)]
    [MessagePackObject()]
    [Obsolete("版本50以上过时")]
    public class ReliefRequest : MessageData
    {
        /// <summary>
        /// 可领救济金的条件
        /// </summary>
        [Key(0)] public int Poor;

        /// <summary>
        /// 救济金的金额
        /// </summary>
        [Key(1)] public int Relief;

        /// <summary>
        /// 是否看广告
        /// </summary>
        [Key(2)] public bool IsAd;

#if GameClient
        public static ReliefRequest Create()
        {
            return ReferencePool.Acquire<ReliefRequest>();
        }
        
        public override void Clear()
        {
            Poor = 0;
            Relief = 0;
            IsAd = false;
        }
#endif
    }

    /// <summary>
    /// 救济金响应
    /// </summary>
    [Message(MessageCode.ReliefResponse)]
    [MessagePackObject()]
    [Obsolete("版本50以上过时")]
    public class ReliefResponse : MessageData
    {
        /// <summary>
        /// 领取到的金额
        /// </summary>
        [Key(0)] public int Money;

        /// <summary>
        /// 领取次数
        /// </summary>
        [Key(1)] public int DoleCnt;

        /// <summary>
        /// 领取结果
        /// </summary>
        [Key(2)] public int ResultCode;
    }


    /// <summary>
    /// 转盘请求
    /// </summary>
    [Message(MessageCode.TurnTableRequest)]
    [MessagePackObject()]
    [Obsolete("版本50以上过时")]
    public class TurnTableRequest : MessageData
    {
        /// <summary>
        /// 是否活动
        /// </summary>
        [Key(0)] public bool IsActivity;
    }

    /// <summary>
    /// 转盘响应
    /// </summary>
    [Message(MessageCode.TurnTableResponse)]
    [MessagePackObject()]
    [Obsolete("版本50以上过时")]
    public class TurnTableResponse : MessageData
    {
        /*
                1 100W金币 50%
                2 80礼券 40%
                3 1参赛卷 3%
                4 1复活卡 3%
                5 300万金币 1%
                6 240礼券 1%
                7 3参赛卷 1%
                8 3张复活卡 1% */
        /// <summary>
        /// 奖励类型
        /// </summary>
        [Key(0)] public int RewardType;

        /// <summary>
        /// 连续领取的次数
        /// </summary>
        [Key(1)] public int ContinuousDoleCnt;

        /// <summary>
        /// 是否活动
        /// </summary>
        [Key(2)] public bool IsActivity;

        /// <summary>
        /// 结果
        /// </summary>
        [Key(3)] public int ResultCode;
    }

    /// <summary>
    /// 签到宝箱领取请求
    /// </summary>
    [Message(MessageCode.SignBoxRequest)]
    [MessagePackObject()]
    [Obsolete("版本50以上过时")]
    public class SignBoxRequest : MessageData
    {
        /// <summary>
        /// 宝箱索引
        /// </summary>
        [Key(0)] public int BoxIndex;

#if GameClient
        public static SignBoxRequest Create(int boxIndex)
        {
            SignBoxRequest request = ReferencePool.Acquire<SignBoxRequest>();
            request.BoxIndex = boxIndex;
            return request;
        }
#endif
    }

    /// <summary>
    /// 签到宝箱领取响应
    /// </summary>
    [Message(MessageCode.SignBoxResponse)]
    [MessagePackObject()]
    [Obsolete("版本50以上过时")]
    public class SignBoxResponse : MessageData
    {
        /// <summary>
        /// 宝箱索引
        /// </summary>
        [Key(0)] public int BoxIndex;

        /// <summary>
        /// 领取结果
        /// </summary>
        [Key(1)] public int ResultCode;
    }

    /// <summary>
    /// 广告礼包请求
    /// </summary>
    [Message(MessageCode.AdGiftRequest)]
    [MessagePackObject()]
    [Obsolete("版本50以上过时")]
    public class AdGiftRequest : MessageData
    {

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

    /// <summary>
    /// 广告礼包响应
    /// </summary>
    [Message(MessageCode.AdGiftResponse)]
    [MessagePackObject()]
    [Obsolete("版本50以上过时")]
    public class AdGiftResponse : MessageData
    {
        /// <summary>
        /// 领取的金额
        /// </summary>
        [Key(0)] public int Money;

        /// <summary>
        /// 领取的次数
        /// </summary>
        [Key(1)] public int AdGiftCnt;

        /// <summary>
        /// 领取结果
        /// </summary>
        [Key(2)] public int ResultCode;
    }

    /// <summary>
    /// 摇钱树请求
    /// </summary>
    [Message(MessageCode.ShakeTreeRequest)]
    [MessagePackObject()]
    public class ShakeTreeRequest : MessageData
    {
        /// <summary>
        /// 摇树次数
        /// </summary>
        [Key(0)] public int Cnt;

#if GameClient
        public static ShakeTreeRequest Create(int cnt)
        {
            ShakeTreeRequest request = ReferencePool.Acquire<ShakeTreeRequest>();
            request.Cnt = cnt;
            return request;
        }
#endif
    }

    /// <summary>
    /// 摇钱树响应
    /// </summary>
    [Message(MessageCode.ShakeTreeResponse)]
    [MessagePackObject()]
    public class ShakeTreeResponse : MessageData
    {
        /// <summary>
        /// 消耗的游戏币
        /// </summary>
        [Key(0)] public long ExpendMoney;

        /// <summary>
        /// 参赛券数量
        /// </summary>
        [Key(1)] public int CanSaiJuanNum;

        /// <summary>
        /// 礼券数量
        /// </summary>
        [Key(2)] public int LiQuanNum;

        /// <summary>
        /// 摇树结果
        /// </summary>
        [Key(3)] public int ResultCode;
    }
}