using System;
using System.Collections.Generic;
#if Server
namespace Server
#else
namespace UnityGame
#endif
{
    public abstract class ActivityPropDataInfo
    {
        /// <summary>
        /// 活动道具类型
        /// </summary>
        public abstract ActivityPropType PropType
        {
            get;
        }

        /// <summary>
        /// 获取道具名称 英文名 也是Redis中的Key
        /// </summary>
        public abstract string[] GetPropNames();
        
        /// <summary>
        /// 获取道具的过期时间
        /// </summary>
        /// <param name="propName">道具名称</param>
        /// <returns></returns>
        public abstract DateTime GetExpireTime(string propName);

        /// <summary>
        /// 道具中文名称
        /// </summary>
        public static readonly Dictionary<ActivityPropType, string> PropName =
            new Dictionary<ActivityPropType, string>()
            {
                {
                    ActivityPropType.MenPiao,
                    "门票"
                },
            };

        /// <summary>
        /// 获取当前周的星期天的24时
        /// </summary>
        /// <returns></returns>
        public static DateTime GetNowWeekSunDay()
        {
            DateTime now = DateTime.Now;
            int daysUntilSunday = ((DayOfWeek.Sunday - now.DayOfWeek) + 7) % 7;
            return now.Date.AddDays(daysUntilSunday + 1); //星期天的24点就是下周一的0点
        }
    }

    public enum ActivityPropType
    {
        /// <summary>
        /// 门票
        /// </summary>
        MenPiao = 1,
    }
}

