ActivityDataManager.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. using System.Collections.Generic;
  2. namespace GFGGame
  3. {
  4. public class ActivityDataManager : SingletonBase<ActivityDataManager>
  5. {
  6. public void Clear()
  7. {
  8. luckyBoxActBonusState.Clear();
  9. }
  10. /**********************************************************活动*************************************************/
  11. /// <summary>
  12. /// 获取指定类型活动当前开启的活动id
  13. /// </summary>
  14. /// <returns></returns>
  15. public int GetCurOpenActiveByType(int type)
  16. {
  17. List<ActivityOpenCfg> activityOpenCfgs = ActivityOpenCfgArray.Instance.GetCfgsBytype(type);
  18. for (int i = 0; i < activityOpenCfgs.Count; i++)
  19. {
  20. if (TimeUtil.IsBeforeCurTime(activityOpenCfgs[i].openTime) && TimeUtil.IsLaterCurTime(activityOpenCfgs[i].endTime))
  21. {
  22. return activityOpenCfgs[i].id;
  23. }
  24. }
  25. return 0;
  26. }
  27. /**********************************************************限时累充*************************************************/
  28. private int _actLimitChargeId = 0;
  29. /// <summary>
  30. /// 当前限时累充活动id
  31. /// </summary>
  32. /// <value></value>
  33. public int actLimitChargeId { get { return _actLimitChargeId; } set { _actLimitChargeId = value; } }
  34. /**********************************************************限时抽奖活动*********************************************/
  35. private int _actLuckyBoxId = 0;
  36. /// <summary>
  37. /// 当前抽奖活动id
  38. /// </summary>
  39. /// <value></value>
  40. public int actLuckyBoxId { get { return _actLuckyBoxId; } set { _actLuckyBoxId = value; } }
  41. /// <summary>
  42. /// 抽奖总次数
  43. /// </summary>
  44. /// <value></value>
  45. public long allPlayTimes { get; set; }
  46. /// <summary>
  47. /// 限时抽奖必掉次数
  48. /// </summary>
  49. /// <value></value>
  50. public int lastDrawCount { get; set; }
  51. /// <summary>
  52. /// </summary>
  53. /// <typeparam name="int">奖励key,这里对应抽奖次数</typeparam>
  54. /// <typeparam name="int">值由ConstBonusStatus定义</typeparam>
  55. /// <returns></returns>
  56. public Dictionary<int, int> luckyBoxActBonusState = new Dictionary<int, int>();
  57. /**********************************************************每日登录*************************************************/
  58. private int _sevenDayLoginLoginId = 1;
  59. /// <summary>
  60. /// 七日登录 当日奖励id
  61. /// </summary>
  62. /// <value></value>
  63. public int sevenDayLoginLoginId
  64. {
  65. get { return _sevenDayLoginLoginId; }
  66. set { _sevenDayLoginLoginId = value; }
  67. }
  68. private int _sevenDayLoginBonusStatus = 0;
  69. /// <summary>
  70. /// 七日登录 当前奖励状态
  71. /// </summary>
  72. /// <value></value>
  73. public int sevenDayLoginBonusStatus
  74. {
  75. get { return _sevenDayLoginBonusStatus; }
  76. set { _sevenDayLoginBonusStatus = value; }
  77. }
  78. /******************************************************************************************************************/
  79. private int _firstChargeBonusStatus = 0;
  80. /// <summary>
  81. /// 首冲奖励 当前奖励状态,ConstBonusStatus 0不可领,1可领,2已领
  82. /// </summary>
  83. /// <value></value>
  84. public int firstChargeBonusStatus
  85. {
  86. get
  87. {
  88. var status = GameGlobal.myNumericComponent.GetAsInt(ET.NumericType.FirstRechargeBonusStatus);
  89. if (status == ConstBonusStatus.GOT)
  90. {
  91. return ConstBonusStatus.GOT;
  92. }
  93. if (GameGlobal.myNumericComponent.GetAsLong(ET.NumericType.RechargeTotal) > 0)
  94. {
  95. return ConstBonusStatus.CAN_GET;
  96. }
  97. return ConstBonusStatus.CAN_NOT_GET;
  98. }
  99. }
  100. }
  101. }