private List <JsonPlayerBuffs> BuildPlayerBuffGenerations(List <Dictionary <long, Statistics.FinalBuffs> > statUptimes, Player player) { var uptimes = new List <JsonPlayerBuffs>(); int phases = _phases.Count; foreach (var pair in statUptimes[0]) { Boon buff = Boon.BoonsByIds[pair.Key]; if (!_buffDesc.ContainsKey("b" + pair.Key)) { _buffDesc["b" + pair.Key] = new JsonLog.BuffDesc(buff); } List <JsonPlayerBuffsData> data = new List <JsonPlayerBuffsData>(); for (int i = 0; i < _phases.Count; i++) { data.Add(new JsonPlayerBuffsData(statUptimes[i][pair.Key], true)); } JsonPlayerBuffs jsonBuffs = new JsonPlayerBuffs() { BuffData = data, Id = pair.Key }; uptimes.Add(jsonBuffs); } if (!uptimes.Any()) { return(null); } return(uptimes); }
private List <JsonPlayerBuffs> BuildPlayerBuffUptimes(List <Dictionary <long, Statistics.FinalBuffs> > statUptimes, Player player) { var uptimes = new List <JsonPlayerBuffs>(); int phases = _phases.Count; foreach (var pair in statUptimes[0]) { Boon buff = Boon.BoonsByIds[pair.Key]; if (!_buffDesc.ContainsKey("b" + pair.Key)) { _buffDesc["b" + pair.Key] = new JsonLog.BuffDesc(buff); } if (buff.Nature == Boon.BoonNature.GraphOnlyBuff && buff.Source == Boon.ProfToEnum(player.Prof)) { if (player.GetBoonDistribution(_log, 0).GetUptime(pair.Key) > 0) { if (_personalBuffs.TryGetValue(player.Prof, out var list) && !list.Contains(pair.Key)) { list.Add(pair.Key); } else { _personalBuffs[player.Prof] = new HashSet <long>() { pair.Key }; } } } List <JsonPlayerBuffsData> data = new List <JsonPlayerBuffsData>(); for (int i = 0; i < _phases.Count; i++) { data.Add(new JsonPlayerBuffsData(statUptimes[i][pair.Key], false)); } JsonPlayerBuffs jsonBuffs = new JsonPlayerBuffs() { States = BuildBuffStates(player.GetBoonGraphs(_log)[pair.Key]), BuffData = data, Id = pair.Key }; uptimes.Add(jsonBuffs); } if (!uptimes.Any()) { return(null); } return(uptimes); }