// helper methods

        private static List <object> GetOutgoingBarrierStatData(EXTFinalOutgoingBarrierStat outgoingBarrierStats)
        {
            var data = new List <object>
            {
                outgoingBarrierStats.Barrier,
            };

            return(data);
        }
        public static List <List <object> > BuildOutgoingBarrierStatData(ParsedEvtcLog log, PhaseData phase)
        {
            var list = new List <List <object> >(log.Friendlies.Count);

            foreach (AbstractSingleActor actor in log.Friendlies)
            {
                EXTFinalOutgoingBarrierStat outgoingBarrierStats = actor.EXTBarrier.GetOutgoingBarrierStats(null, log, phase.Start, phase.End);
                list.Add(GetOutgoingBarrierStatData(outgoingBarrierStats));
            }
            return(list);
        }
        private static EXTBarrierStatsBarrierDistributionDto BuildBarrierDistDataMinionsInternal(ParsedEvtcLog log, EXTFinalOutgoingBarrierStat outgoingBarrierStats, Minions minions, AbstractSingleActor target, PhaseData phase, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs)
        {
            var dto = new EXTBarrierStatsBarrierDistributionDto();
            IReadOnlyList <AbstractCastEvent>       casting     = minions.GetIntersectingCastEvents(log, phase.Start, phase.End);
            IReadOnlyList <EXTAbstractBarrierEvent> barrierLogs = minions.EXTBarrier.GetOutgoingBarrierEvents(target, log, phase.Start, phase.End);

            dto.ContributedBarrier = barrierLogs.Sum(x => x.BarrierGiven);
            dto.TotalBarrier       = outgoingBarrierStats.Barrier;
            dto.TotalCasting       = casting.Sum(cl => Math.Min(cl.EndTime, phase.End) - Math.Max(cl.Time, phase.Start));
            dto.Distribution       = BuildBarrierDistBodyData(log, casting, barrierLogs, usedSkills, usedBuffs, phase);
            return(dto);
        }
        public static EXTBarrierStatsBarrierDistributionDto BuildFriendlyMinionBarrierDistData(ParsedEvtcLog log, AbstractSingleActor actor, Minions minions, AbstractSingleActor target, PhaseData phase, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs)
        {
            EXTFinalOutgoingBarrierStat outgoingBarrierStats = actor.EXTBarrier.GetOutgoingBarrierStats(target, log, phase.Start, phase.End);

            return(BuildBarrierDistDataMinionsInternal(log, outgoingBarrierStats, minions, target, phase, usedSkills, usedBuffs));
        }
        internal static EXTJsonBarrierStatistics.EXTJsonOutgoingBarrierStatistics BuildOutgoingBarrierStatistics(EXTFinalOutgoingBarrierStat stats)
        {
            return(new EXTJsonBarrierStatistics.EXTJsonOutgoingBarrierStatistics()
            {
                Barrier = stats.Barrier,
                Bps = stats.Bps,

                ActorBarrier = stats.ActorBarrier,
                ActorBps = stats.ActorBps
            });
        }