/// <summary> /// 0706 回应炮弹兵数据 /// </summary> /// <param name="Info"></param> /// <returns></returns> public static bool RecvStageScheduleResponse(object obj) { ClearDC(); if (obj == null) { return(false); } stage.StageScheduleResponse Info = obj as stage.StageScheduleResponse; //普通副本 m_NormalStage = Info.normal; foreach (stage.StageScheduleResponse.ScheduleInfo I in Info.normal_info) { GatePassInfo g = new GatePassInfo(); g.star = I.star; g.times = I.times; g.stageid = I.stageid; m_NormalStagePass.Add(g); } //精英副本 m_HardStage = Info.hard; foreach (stage.StageScheduleResponse.ScheduleInfo I in Info.hard_info) { GatePassInfo g = new GatePassInfo(); g.star = I.star; g.times = I.times; g.stageid = I.stageid; m_HardStagePass.Add(g); } //团队副本 //精英副本 m_TeamStage = Info.team; foreach (stage.StageScheduleResponse.ScheduleInfo I in Info.team_info) { GatePassInfo g = new GatePassInfo(); g.star = I.star; g.times = I.times; g.stageid = I.stageid; m_TeamStagePass.Add(g); } m_FirstNormalStage = StageM.FindFirstCanAttackStage(StageType.Normal, m_NormalStage); m_FirstHardStage = StageM.FindFirstCanAttackStage(StageType.Hard, m_HardStage); m_FirstTeamStage = StageM.FindFirstCanAttackStage(StageType.Team, m_TeamStage); return(true); }
/// <summary> /// 更新章节进度 /// </summary> public static void UpdataStageScheduler(GatePassInfo Info) { if (Info == null) { return; } int type = Info.CouterType; if (type == (int)StageType.Normal) { if (Info.stageid > m_NormalStage) { m_NormalStage = Info.stageid; m_NormalStagePass.Add(Info); m_FirstNormalStage = StageM.FindFirstCanAttackStage(StageType.Normal, m_NormalStage); } else { bool IsHave = false; for (int i = 0; i < m_NormalStagePass.Count; i++) { if (m_NormalStagePass[i].stageid == Info.stageid) { if (m_NormalStagePass[i].star < Info.star) { m_NormalStagePass[i].star = Info.star; } m_NormalStagePass[i].times++; IsHave = true; break; } } if (IsHave == false) { Info.times = 1; m_NormalStagePass.Add(Info); } } } else if (type == (int)StageType.Hard) { if (Info.stageid > m_HardStage) { m_HardStage = Info.stageid; m_HardStagePass.Add(Info); m_FirstHardStage = StageM.FindFirstCanAttackStage(StageType.Hard, m_HardStage); } else { bool IsHave = false; for (int i = 0; i < m_HardStagePass.Count; i++) { if (m_HardStagePass[i].stageid == Info.stageid) { if (m_HardStagePass[i].star < Info.star) { m_HardStagePass[i].star = Info.star; } m_HardStagePass[i].times++; IsHave = true; break; } } if (IsHave == false) { Info.times = 1; m_HardStagePass.Add(Info); } } } else { if (Info.stageid > m_TeamStage) { m_TeamStage = Info.stageid; m_TeamStagePass.Add(Info); m_FirstTeamStage = StageM.FindFirstCanAttackStage(StageType.Team, m_TeamStage); } else { bool IsHave = false; for (int i = 0; i < m_TeamStagePass.Count; i++) { if (m_TeamStagePass[i].stageid == Info.stageid) { if (m_TeamStagePass[i].star < Info.star) { m_TeamStagePass[i].star = Info.star; } m_TeamStagePass[i].times++; IsHave = true; break; } } if (IsHave == false) { Info.times = 1; m_TeamStagePass.Add(Info); } } } }