| | |
| | | //春节活动巡礼
|
| | | public class SpringFestivalModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | | public Dictionary<int, WeekPartyDayInfoClass> SpringFestivalInfoDic = new Dictionary<int, WeekPartyDayInfoClass>();//每天领取奖励信息
|
| | | public event Action SpringFestivalRewardUpdate;
|
| | | public override void Init()
|
| | | {
|
| | |
|
| | |
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | |
| | | SpringFestivalInfoDic.Clear();
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | |
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | public void SpringFestivalInfo(HAA0B_tagMCWeekPartyPlayerInfo info)//每天领奖信息
|
| | | {
|
| | | for (int i = 0; i < info.Count; i++)
|
| | | {
|
| | | var DayInfo = info.DayInfoList[i];
|
| | | WeekPartyDayInfoClass WeekPartyDayInfo = new WeekPartyDayInfoClass();
|
| | | WeekPartyDayInfo.DayIndex = (int)DayInfo.DayIndex;
|
| | | WeekPartyDayInfo.Point = (int)DayInfo.Point;
|
| | | WeekPartyDayInfo.AwardRecord = (int)DayInfo.AwardRecord;
|
| | |
|
| | | if (SpringFestivalInfoDic.ContainsKey((int)DayInfo.DayIndex))
|
| | | {
|
| | | var dit = SpringFestivalInfoDic[(int)DayInfo.DayIndex];
|
| | | dit.DayIndex = (int)DayInfo.DayIndex;
|
| | | dit.Point = (int)DayInfo.Point;
|
| | | dit.AwardRecord = (int)DayInfo.AwardRecord;
|
| | | for (int j = 0; j < dit.ActionType.Length; j++)
|
| | | {
|
| | | if (dit.ActionType[j].TemplateID == DayInfo.TaskList[0].TemplateID)
|
| | | {
|
| | | ActionTypeClass ActionType = new ActionTypeClass();
|
| | | ActionType.TemplateID = DayInfo.TaskList[0].TemplateID;
|
| | | ActionType.CurTimes = DayInfo.TaskList[0].CurTimes;
|
| | | ActionType.GotTimes = DayInfo.TaskList[0].GotTimes;
|
| | | dit.ActionType[j] = ActionType;
|
| | | }
|
| | | }
|
| | | SpringFestivalInfoDic[(int)DayInfo.DayIndex] = dit;
|
| | | }
|
| | | else
|
| | | {
|
| | | WeekPartyDayInfo.ActionType = new ActionTypeClass[DayInfo.ACount];
|
| | | for (int k = 0; k < DayInfo.ACount; k++)
|
| | | {
|
| | | var Task = DayInfo.TaskList[k];
|
| | | ActionTypeClass ActionType = new ActionTypeClass();
|
| | | ActionType.TemplateID = Task.TemplateID;
|
| | | ActionType.CurTimes = Task.CurTimes;
|
| | | ActionType.GotTimes = Task.GotTimes;
|
| | | WeekPartyDayInfo.ActionType[k] = ActionType;
|
| | | }
|
| | | SpringFestivalInfoDic.Add((int)DayInfo.DayIndex, WeekPartyDayInfo);
|
| | | }
|
| | | }
|
| | | if (SpringFestivalRewardUpdate != null)
|
| | | {
|
| | | SpringFestivalRewardUpdate();
|
| | | }
|
| | | }
|
| | | } |
| | | |
| | | |