示例#1
0
        private static List <JsonBuffsUptime> GetPlayerJsonBuffsUptime(Player player, List <Dictionary <long, FinalPlayerBuffs> > buffs, List <Dictionary <long, FinalBuffsDictionary> > buffsDictionary, ParsedLog log, Dictionary <string, JsonLog.BuffDesc> buffDesc, Dictionary <string, HashSet <long> > personalBuffs)
        {
            var res = new List <JsonBuffsUptime>();
            List <PhaseData> phases = log.FightData.GetPhases(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++)
                {
                    var value = new JsonBuffsUptimeData(buffs[i][pair.Key], buffsDictionary[i][pair.Key]);
                    data.Add(value);
                }
                if (buff.Nature == Buff.BuffNature.GraphOnlyBuff && buff.Source == Buff.ProfToEnum(player.Prof))
                {
                    if (player.GetBuffDistribution(log, 0).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(new JsonBuffsUptime(player, pair.Key, log, data, buffDesc));
            }
            return(res);
        }
        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);
        }
示例#3
0
        private static List <JsonBuffsUptime> GetNPCJsonBuffsUptime(NPC npc, List <Dictionary <long, FinalBuffs> > buffs, List <Dictionary <long, FinalBuffsDictionary> > buffsDictionary, ParsedEvtcLog log, RawFormatSettings settings, Dictionary <string, JsonLog.BuffDesc> buffDesc)
        {
            var res = new List <JsonBuffsUptime>();
            List <PhaseData> phases = log.FightData.GetPhases(log);

            foreach (KeyValuePair <long, FinalBuffs> pair in buffs[0])
            {
                var data = new List <JsonBuffsUptimeData>();
                for (int i = 0; i < phases.Count; i++)
                {
                    if (buffs[i].TryGetValue(pair.Key, out FinalBuffs val))
                    {
                        var value = new JsonBuffsUptimeData(val, buffsDictionary[i][pair.Key]);
                        data.Add(value);
                    }
                    else
                    {
                        var value = new JsonBuffsUptimeData();
                        data.Add(value);
                    }
                }
                res.Add(new JsonBuffsUptime(npc, pair.Key, log, settings, data, buffDesc));
            }
            return(res);
        }
示例#4
0
        public static JsonBuffsUptimeData BuildJsonBuffsUptimeData(FinalBuffs buffs, FinalBuffsDictionary buffsDictionary)
        {
            var jsonBuffsUptimeData = new JsonBuffsUptimeData();

            jsonBuffsUptimeData.Uptime          = buffs.Uptime;
            jsonBuffsUptimeData.Presence        = buffs.Presence;
            jsonBuffsUptimeData.Generated       = ConvertKeys(buffsDictionary.Generated);
            jsonBuffsUptimeData.Overstacked     = ConvertKeys(buffsDictionary.Overstacked);
            jsonBuffsUptimeData.Wasted          = ConvertKeys(buffsDictionary.Wasted);
            jsonBuffsUptimeData.UnknownExtended = ConvertKeys(buffsDictionary.UnknownExtension);
            jsonBuffsUptimeData.ByExtension     = ConvertKeys(buffsDictionary.Extension);
            jsonBuffsUptimeData.Extended        = ConvertKeys(buffsDictionary.Extended);
            return(jsonBuffsUptimeData);
        }
示例#5
0
        public static JsonBuffsUptimeData BuildJsonBuffsUptimeData(FinalActorBuffs buffs, FinalBuffsDictionary buffsDictionary)
        {
            var jsonBuffsUptimeData = new JsonBuffsUptimeData
            {
                Uptime          = buffs.Uptime,
                Presence        = buffs.Presence,
                Generated       = ConvertKeys(buffsDictionary.Generated),
                Overstacked     = ConvertKeys(buffsDictionary.Overstacked),
                Wasted          = ConvertKeys(buffsDictionary.Wasted),
                UnknownExtended = ConvertKeys(buffsDictionary.UnknownExtension),
                ByExtension     = ConvertKeys(buffsDictionary.Extension),
                Extended        = ConvertKeys(buffsDictionary.Extended)
            };

            return(jsonBuffsUptimeData);
        }
示例#6
0
        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>(ParserHelper.ProfToEnum(player.Prof));
            IReadOnlyList <PhaseData> phases = log.FightData.GetPhases(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))
                    {
                        var value = new JsonBuffsUptimeData(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(new JsonBuffsUptime(player, pair.Key, log, settings, data, buffDesc));
            }
            return(res);
        }
        private static List <JsonBuffsUptime> GetPlayerJsonBuffsUptime(AbstractSingleActor player, List <IReadOnlyDictionary <long, FinalActorBuffs> > 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>(SpecToSources(player.Spec));
            IReadOnlyList <PhaseData> phases = log.FightData.GetNonDummyPhases(log);

            foreach (KeyValuePair <long, FinalActorBuffs> 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 FinalActorBuffs val))
                    {
                        JsonBuffsUptimeData value = JsonBuffsUptimeBuilder.BuildJsonBuffsUptimeData(val, buffsDictionary[pair.Key]);
                        data.Add(value);
                    }
                    else
                    {
                        var value = new JsonBuffsUptimeData();
                        data.Add(value);
                    }
                }
                if (buff.Classification == Buff.BuffClassification.Other && profEnums.Contains(buff.Source))
                {
                    if (player.GetBuffDistribution(log, phases[0].Start, phases[0].End).GetUptime(pair.Key) > 0)
                    {
                        if (personalBuffs.TryGetValue(player.Spec.ToString(), out HashSet <long> list) && !list.Contains(pair.Key))
                        {
                            list.Add(pair.Key);
                        }
                        else
                        {
                            personalBuffs[player.Spec.ToString()] = new HashSet <long>()
                            {
                                pair.Key
                            };
                        }
                    }
                }
                res.Add(JsonBuffsUptimeBuilder.BuildJsonBuffsUptime(player, pair.Key, log, settings, data, buffDesc));
            }
            return(res);
        }
示例#8
0
        private static List <JsonBuffsUptime> GetNPCJsonBuffsUptime(NPC npc, List <Dictionary <long, FinalBuffs> > buffs, List <Dictionary <long, FinalBuffsDictionary> > buffsDictionary, ParsedLog log, Dictionary <string, JsonLog.BuffDesc> buffDesc)
        {
            var res = new List <JsonBuffsUptime>();
            List <PhaseData> phases = log.FightData.GetPhases(log);

            foreach (KeyValuePair <long, FinalBuffs> pair in buffs[0])
            {
                var data = new List <JsonBuffsUptimeData>();
                for (int i = 0; i < phases.Count; i++)
                {
                    var value = new JsonBuffsUptimeData(buffs[i][pair.Key], buffsDictionary[i][pair.Key]);
                    data.Add(value);
                }
                res.Add(new JsonBuffsUptime(npc, pair.Key, log, data, buffDesc));
            }
            return(res);
        }