private void EIBuffParse(List <Player> players, SkillData skillData, FightData fightData) { var toAdd = new List <AbstractBuffEvent>(); foreach (Player p in players) { if (p.Spec == ParserHelper.Spec.Weaver) { toAdd.AddRange(WeaverHelper.TransformWeaverAttunements(GetBuffData(p.AgentItem), _buffData, p.AgentItem, skillData)); } if (p.BaseSpec == ParserHelper.Spec.Elementalist && p.Spec != ParserHelper.Spec.Weaver) { ElementalistHelper.RemoveDualBuffs(GetBuffData(p.AgentItem), _buffData, skillData); } } toAdd.AddRange(fightData.Logic.SpecialBuffEventProcess(this, skillData)); var buffIDsToSort = new HashSet <long>(); var buffAgentsToSort = new HashSet <AgentItem>(); foreach (AbstractBuffEvent bf in toAdd) { if (_buffDataByDst.TryGetValue(bf.To, out List <AbstractBuffEvent> buffByDstList)) { buffByDstList.Add(bf); } else { _buffDataByDst[bf.To] = new List <AbstractBuffEvent>() { bf }; } buffAgentsToSort.Add(bf.To); if (_buffData.TryGetValue(bf.BuffID, out List <AbstractBuffEvent> buffByIDList)) { buffByIDList.Add(bf); } else { _buffData[bf.BuffID] = new List <AbstractBuffEvent>() { bf }; } buffIDsToSort.Add(bf.BuffID); } foreach (long buffID in buffIDsToSort) { _buffData[buffID] = _buffData[buffID].OrderBy(x => x.Time).ToList(); } foreach (AgentItem a in buffAgentsToSort) { _buffDataByDst[a] = _buffDataByDst[a].OrderBy(x => x.Time).ToList(); } if (toAdd.Any()) { _buffRemoveAllData = _buffData.ToDictionary(x => x.Key, x => x.Value.OfType <BuffRemoveAllEvent>().ToList()); } }
private void EIBuffParse(List <Player> players, SkillData skillData, FightData fightData) { var toAdd = new List <AbstractBuffEvent>(); WarriorHelper.AttachMasterToBanners(players, _buffData, _castDataById); foreach (Player p in players) { if (p.Prof == "Weaver") { toAdd = WeaverHelper.TransformWeaverAttunements(GetBuffDataByDst(p.AgentItem), p.AgentItem, skillData); } if (p.Prof == "Elementalist" || p.Prof == "Tempest") { ElementalistHelper.RemoveDualBuffs(GetBuffDataByDst(p.AgentItem), skillData); } } toAdd.AddRange(fightData.Logic.SpecialBuffEventProcess(_buffDataByDst, _buffData, skillData)); var buffIDsToSort = new HashSet <long>(); var buffAgentsToSort = new HashSet <AgentItem>(); foreach (AbstractBuffEvent bf in toAdd) { if (_buffDataByDst.TryGetValue(bf.To, out List <AbstractBuffEvent> list1)) { list1.Add(bf); } else { _buffDataByDst[bf.To] = new List <AbstractBuffEvent>() { bf }; } buffAgentsToSort.Add(bf.To); if (_buffData.TryGetValue(bf.BuffID, out List <AbstractBuffEvent> list2)) { list2.Add(bf); } else { _buffData[bf.BuffID] = new List <AbstractBuffEvent>() { bf }; } buffIDsToSort.Add(bf.BuffID); } foreach (long buffID in buffIDsToSort) { _buffData[buffID].Sort((x, y) => x.Time.CompareTo(y.Time)); } foreach (AgentItem a in buffAgentsToSort) { _buffDataByDst[a].Sort((x, y) => x.Time.CompareTo(y.Time)); } }