private static List <JsonBuffsUptime> GetNPCJsonBuffsUptime(NPC npc, ParsedEvtcLog log, RawFormatSettings settings, Dictionary <string, JsonLog.BuffDesc> buffDesc)
        {
            var res = new List <JsonBuffsUptime>();
            IReadOnlyList <PhaseData> phases = log.FightData.GetNonDummyPhases(log);
            var buffs = phases.Select(x => npc.GetBuffs(log, x.Start, x.End)).ToList();

            foreach (KeyValuePair <long, FinalBuffs> pair in buffs[0])
            {
                var data = new List <JsonBuffsUptimeData>();
                for (int i = 0; i < phases.Count; i++)
                {
                    PhaseData phase = phases[i];
                    Dictionary <long, FinalBuffsDictionary> buffsDictionary = npc.GetBuffsDictionary(log, phase.Start, phase.End);
                    if (buffs[i].TryGetValue(pair.Key, out FinalBuffs val))
                    {
                        JsonBuffsUptimeData value = JsonBuffsUptimeBuilder.BuildJsonBuffsUptimeData(val, buffsDictionary[pair.Key]);
                        data.Add(value);
                    }
                    else
                    {
                        var value = new JsonBuffsUptimeData();
                        data.Add(value);
                    }
                }
                res.Add(JsonBuffsUptimeBuilder.BuildJsonBuffsUptime(npc, pair.Key, log, settings, data, buffDesc));
            }
            return(res);
        }
        private static List <JsonBuffsUptime> GetPlayerJsonBuffsUptime(Player player, List <IReadOnlyDictionary <long, FinalPlayerBuffs> > buffs, ParsedEvtcLog log, RawFormatSettings settings, Dictionary <string, JsonLog.BuffDesc> buffDesc, Dictionary <string, HashSet <long> > personalBuffs)
        {
            var res       = new List <JsonBuffsUptime>();
            var profEnums = new HashSet <ParserHelper.Source>(ProfToEnum(player.Prof));
            IReadOnlyList <PhaseData> phases = log.FightData.GetNonDummyPhases(log);

            foreach (KeyValuePair <long, FinalPlayerBuffs> pair in buffs[0])
            {
                Buff buff = log.Buffs.BuffsByIds[pair.Key];
                var  data = new List <JsonBuffsUptimeData>();
                for (int i = 0; i < phases.Count; i++)
                {
                    PhaseData phase = phases[i];
                    Dictionary <long, FinalBuffsDictionary> buffsDictionary = player.GetBuffsDictionary(log, phase.Start, phase.End);
                    if (buffs[i].TryGetValue(pair.Key, out FinalPlayerBuffs val))
                    {
                        JsonBuffsUptimeData value = JsonBuffsUptimeBuilder.BuildJsonBuffsUptimeData(val, buffsDictionary[pair.Key]);
                        data.Add(value);
                    }
                    else
                    {
                        var value = new JsonBuffsUptimeData();
                        data.Add(value);
                    }
                }
                if (buff.Nature == Buff.BuffNature.GraphOnlyBuff && profEnums.Contains(buff.Source))
                {
                    if (player.GetBuffDistribution(log, phases[0].Start, phases[0].End).GetUptime(pair.Key) > 0)
                    {
                        if (personalBuffs.TryGetValue(player.Prof, out HashSet <long> list) && !list.Contains(pair.Key))
                        {
                            list.Add(pair.Key);
                        }
                        else
                        {
                            personalBuffs[player.Prof] = new HashSet <long>()
                            {
                                pair.Key
                            };
                        }
                    }
                }
                res.Add(JsonBuffsUptimeBuilder.BuildJsonBuffsUptime(player, pair.Key, log, settings, data, buffDesc));
            }
            return(res);
        }