public void AddNewStage(SCRaidNewStage stage) { var stageinfo = new RaidStageInfo(); stageinfo.Star = 0; stageinfo.TemplateId = stage.StageTemplateId; bool flag = true; var raids = GetCurrentRaids(); for (int i = 0; i < raids.Count; i++) { if (raids[i].TemplateId == stage.RaidTemplateId) { raids[i].StateInfo.Add(stageinfo); flag = false; } } if (flag) { MissionStep = RaidType.StepRaidList; var raid = new RaidInfo(); raid.TemplateId = stage.RaidTemplateId; raid.StateInfo = new List<RaidStageInfo>(); raid.StateInfo.Add(stageinfo); raids.Add(raid); } SetCurrentRaids(raids); }
public List<RaidInfo> GetRaidsByType(int thetype) { var raidtemplates = RaidTemplates.RaidTmpls; var newraids = new List<RaidInfo>(); var raids = (thetype == RaidType.RaidElite) ? RaidLoadingAll.RaidInfoElite : RaidLoadingAll.RaidInfoMaster; foreach (KeyValuePair<int, RaidTemplate> item in raidtemplates) { if (item.Value.RaidType == thetype)// && PlayerModelLocator.Instance.Level >= item.Value.OpenLvl) { RaidInfo raid = null; for (int i = 0; i < raids.Count; i++) { if (raids[i].TemplateId == item.Value.Id) { raid = raids[i]; break; } } if (raid == null) { raid = new RaidInfo(); raid.TemplateId = item.Value.Id; raid.StateInfo = new List<RaidStageInfo>(); } foreach (KeyValuePair<int, RaidStageTemplate> stageitem in RaidTemplates.RaidStageTmpls) { if (stageitem.Value.RaidId == raid.TemplateId) { var flag = true; for (int i = 0; i < raid.StateInfo.Count; i++) { if (raid.StateInfo[i].TemplateId == stageitem.Value.Id) { flag = false; break; } } if (flag) { var stage = new RaidStageInfo(); stage.Star = 0; stage.TemplateId = stageitem.Value.Id; raid.StateInfo.Add(stage); } } } newraids.Add(raid); } } return newraids; }