using System.Collections.Generic; namespace GFGGame { public class ActivityDataManager : SingletonBase { public void Clear() { luckyBoxActBonusState.Clear(); } /**********************************************************活动*************************************************/ /// /// 获取指定类型活动当前开启的活动id /// /// public int GetCurOpenActiveByType(int type) { List activityOpenCfgs = ActivityOpenCfgArray.Instance.GetCfgsBytype(type); for (int i = 0; i < activityOpenCfgs.Count; i++) { if (TimeUtil.IsBeforeCurTime(activityOpenCfgs[i].openTime) && TimeUtil.IsLaterCurTime(activityOpenCfgs[i].endTime)) { return activityOpenCfgs[i].id; } } return 0; } /**********************************************************限时累充*************************************************/ private int _actLimitChargeId = 0; /// /// 当前限时累充活动id /// /// public int actLimitChargeId { get { return _actLimitChargeId; } set { _actLimitChargeId = value; } } /**********************************************************限时抽奖活动*********************************************/ private int _actLuckyBoxId = 0; /// /// 当前抽奖活动id /// /// public int actLuckyBoxId { get { return _actLuckyBoxId; } set { _actLuckyBoxId = value; } } /// /// 抽奖总次数 /// /// public long allPlayTimes { get; set; } /// /// 限时抽奖必掉次数 /// /// public int lastDrawCount { get; set; } /// /// /// 奖励key,这里对应抽奖次数 /// 值由ConstBonusStatus定义 /// public Dictionary luckyBoxActBonusState = new Dictionary(); public List SortActivityLuckybonusCfg(List list) { list.Sort((ActivityLuckybonusCfg a, ActivityLuckybonusCfg b) => { long allPlayTimes = ActivityDataManager.Instance.allPlayTimes;// GameGlobal.myNumericComponent.GetAsInt(NumericType.TotalRechargeScore); int stateA = ActivityDataManager.Instance.luckyBoxActBonusState.ContainsKey(a.num) ? 1 : -1; int stateB = ActivityDataManager.Instance.luckyBoxActBonusState.ContainsKey(b.num) ? 1 : -1; if (allPlayTimes >= a.num && allPlayTimes < b.num && stateA < 0) return -1; if (allPlayTimes >= b.num && allPlayTimes < a.num && stateB < 0) return 1; if (stateA >= 0 && stateB < 0) return 1; if (stateB >= 0 && stateA < 0) return -1; return a.num - b.num; }); return list; } /**********************************************************每日登录*************************************************/ private int _sevenDayLoginLoginId = 1; /// /// 七日登录 当日奖励id /// /// public int sevenDayLoginLoginId { get { return _sevenDayLoginLoginId; } set { _sevenDayLoginLoginId = value; } } private int _sevenDayLoginBonusStatus = 0; /// /// 七日登录 当前奖励状态 /// /// public int sevenDayLoginBonusStatus { get { return _sevenDayLoginBonusStatus; } set { _sevenDayLoginBonusStatus = value; } } /******************************************************************************************************************/ private int _firstChargeBonusStatus = 0; /// /// 首冲奖励 当前奖励状态,ConstBonusStatus 0不可领,1可领,2已领 /// /// public int firstChargeBonusStatus { get { var status = GameGlobal.myNumericComponent.GetAsInt(ET.NumericType.FirstRechargeBonusStatus); if (status == ConstBonusStatus.GOT) { return ConstBonusStatus.GOT; } if (GameGlobal.myNumericComponent.GetAsLong(ET.NumericType.RechargeTotal) > 0) { return ConstBonusStatus.CAN_GET; } return ConstBonusStatus.CAN_NOT_GET; } } } }