| | |
| | | public int LimitLV = 0;//限制等级
|
| | | public Dictionary<int, WeekPartyDayClass> WeekPartyDayDic = new Dictionary<int, WeekPartyDayClass>();//每天的奖励信息
|
| | | public Dictionary<int, WeekPartyActionClass> WeekPartyActionDic = new Dictionary<int, WeekPartyActionClass>();//活动模板信息
|
| | | public Dictionary<int, Redpoint> RedPointDic = new Dictionary<int, Redpoint>();//红点
|
| | | public event Action WeekPartyUpdate;//活动信息变更
|
| | |
|
| | | private const int Redpoint_key1 = 666666;//周狂欢红点
|
| | | public Redpoint redPointStre1 = new Redpoint(666, Redpoint_key1);
|
| | | private int _SelectedNow = 0;
|
| | | public int SelectedNow//选中天
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | | GetDayNow();//获取当前天数
|
| | | SetRedPoint();
|
| | | if (WeekPartyDayInfoUpdate != null)
|
| | | {
|
| | | WeekPartyDayInfoUpdate();
|
| | |
| | | }
|
| | | }// 活动模板信息
|
| | | GetDayNow();
|
| | | SetRedPoint();
|
| | | if (WeekPartyUpdate != null)
|
| | | {
|
| | | WeekPartyUpdate();
|
| | |
| | | _bool = MathUtility.GetBitValue((uint)AwardRecord, (ushort)index);
|
| | | return _bool;
|
| | | }
|
| | | private void SetRedPoint()//红点设置
|
| | | {
|
| | | SetRedPointId();
|
| | | foreach (var key in RedPointDic.Keys)
|
| | | {
|
| | | RedPointDic[key].state = RedPointState.None;
|
| | | }
|
| | | foreach (var key in RedPointDic.Keys)
|
| | | {
|
| | | RedPointDic[key].state = SetRedPointState(key);
|
| | | }
|
| | | }
|
| | | private void SetRedPointId()//设置红点ID
|
| | | {
|
| | | if (RedPointDic.Count > 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | | foreach (var key in WeekPartyDayInfoDic.Keys)
|
| | | {
|
| | | int RedPoint = Redpoint_key1 * 10 + key;
|
| | | if (!RedPointDic.ContainsKey(RedPoint))
|
| | | {
|
| | | Redpoint redPointMountStare = new Redpoint(Redpoint_key1, RedPoint);
|
| | | RedPointDic.Add(RedPoint, redPointMountStare);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | private RedPointState SetRedPointState(int day)//红点状态设置
|
| | | {
|
| | | if (!WeekPartyDayDic.ContainsKey(day) || !WeekPartyDayInfoDic.ContainsKey(day))
|
| | | {
|
| | | return RedPointState.None;
|
| | | }
|
| | | WeekPartyDayClass WeekPartyDay = new WeekPartyDayClass();
|
| | | int point = WeekPartyDayInfoDic[day].Point;
|
| | | foreach (var key in WeekPartyDayDic.Keys)
|
| | | {
|
| | | if (key == day)
|
| | | {
|
| | | WeekPartyDay = WeekPartyDayDic[key];
|
| | | }
|
| | | }
|
| | | for (int i = 0; i < WeekPartyDay.WeekPartyItem.Length; i++)//积分奖励
|
| | | {
|
| | | var item = WeekPartyDay.WeekPartyItem[i];
|
| | | int type = i;
|
| | | bool IsBool = IsDayReward(day, type);
|
| | | if (point >= item.NeedPoint && !IsBool)
|
| | | {
|
| | | return RedPointState.Simple;
|
| | | }
|
| | | }
|
| | | for (int i = 0; i < WeekPartyDay.TemplateList.Length; i++)
|
| | | {
|
| | | var TemplateID = WeekPartyDay.TemplateList[i];
|
| | | if (WeekPartyActionDic.ContainsKey(TemplateID))
|
| | | {
|
| | | var WeekPartyAction = WeekPartyActionDic[TemplateID];
|
| | | int number = WeekPartyAction.TotalTimes / WeekPartyAction.SingleTimes;
|
| | | int rewardNum = GetRewardNumber(day, TemplateID);//已领奖次数
|
| | | int carryOutNum = GetCarryOutNum(day, TemplateID);//已完成次数
|
| | | int TaypeNumber = 0;
|
| | | if (carryOutNum - rewardNum > 0)
|
| | | {
|
| | | TaypeNumber = (carryOutNum - rewardNum) / WeekPartyAction.SingleTimes;
|
| | | }
|
| | | if (TaypeNumber > 0)
|
| | | {
|
| | | return RedPointState.Simple;
|
| | | }
|
| | | }
|
| | | }
|
| | | return RedPointState.None;
|
| | | }
|
| | | } |
| | | |
| | | |