public static JsonBuffsGenerationData BuildJsonBuffsGenerationData(FinalPlayerBuffs stats)
        {
            var jsonBuffsGenerationData = new JsonBuffsGenerationData();

            jsonBuffsGenerationData.Generation      = stats.Generation;
            jsonBuffsGenerationData.Overstack       = stats.Overstack;
            jsonBuffsGenerationData.Wasted          = stats.Wasted;
            jsonBuffsGenerationData.UnknownExtended = stats.UnknownExtended;
            jsonBuffsGenerationData.Extended        = stats.Extended;
            jsonBuffsGenerationData.ByExtension     = stats.ByExtension;
            return(jsonBuffsGenerationData);
        }
Exemple #2
0
        private static List <JsonPlayerBuffsGeneration> GetPlayerBuffGenerations(List <IReadOnlyDictionary <long, FinalPlayerBuffs> > buffs, ParsedEvtcLog log, Dictionary <string, JsonLog.BuffDesc> buffDesc)
        {
            IReadOnlyList <PhaseData> phases = log.FightData.GetPhases(log);
            var uptimes = new List <JsonPlayerBuffsGeneration>();

            foreach (KeyValuePair <long, FinalPlayerBuffs> pair in buffs[0])
            {
                Buff buff = log.Buffs.BuffsByIds[pair.Key];
                if (!buffDesc.ContainsKey("b" + pair.Key))
                {
                    buffDesc["b" + pair.Key] = new JsonLog.BuffDesc(buff, log);
                }
                var data = new List <JsonBuffsGenerationData>();
                for (int i = 0; i < phases.Count; i++)
                {
                    if (buffs[i].TryGetValue(pair.Key, out FinalPlayerBuffs val))
                    {
                        var value = new JsonBuffsGenerationData(val);
                        data.Add(value);
                    }
                    else
                    {
                        var value = new JsonBuffsGenerationData();
                        data.Add(value);
                    }
                }
                var jsonBuffs = new JsonPlayerBuffsGeneration()
                {
                    BuffData = data,
                    Id       = pair.Key
                };
                uptimes.Add(jsonBuffs);
            }

            if (!uptimes.Any())
            {
                return(null);
            }

            return(uptimes);
        }