Пример #1
0
        internal static ChartDataDto BuildChartData(ParsedEvtcLog log)
        {
            var chartData           = new ChartDataDto();
            var phaseChartData      = new List <PhaseChartDataDto>();
            List <PhaseData> phases = log.FightData.GetPhases(log);

            for (int i = 0; i < phases.Count; i++)
            {
                var phaseData = new PhaseChartDataDto()
                {
                    Players = PlayerChartDataDto.BuildPlayersGraphData(log, i)
                };
                foreach (NPC target in phases[i].Targets)
                {
                    phaseData.Targets.Add(TargetChartDataDto.BuildTargetGraphData(log, i, target));
                }
                if (i == 0)
                {
                    phaseData.TargetsHealthStatesForCR          = new List <List <object[]> >();
                    phaseData.TargetsBreakbarPercentStatesForCR = new List <List <object[]> >();
                    foreach (NPC target in log.FightData.Logic.Targets)
                    {
                        phaseData.TargetsHealthStatesForCR.Add(BuildHealthGraphStates(log, target, phases[0], false));
                        phaseData.TargetsBreakbarPercentStatesForCR.Add(BuildBreakbarPercentStates(log, target, phases[0]));
                    }
                }

                phaseChartData.Add(phaseData);
            }
            chartData.Phases    = phaseChartData;
            chartData.Mechanics = MechanicChartDataDto.BuildMechanicsChartData(log);
            return(chartData);
        }
        public static List <PlayerChartDataDto> BuildPlayersGraphData(ParsedEvtcLog log, int phaseIndex)
        {
            var       list  = new List <PlayerChartDataDto>();
            PhaseData phase = log.FightData.GetPhases(log)[phaseIndex];

            foreach (Player p in log.PlayerList)
            {
                var pChar = new PlayerChartDataDto()
                {
                    Damage = new PlayerDamageChartDto <int>()
                    {
                        Total   = p.Get1SDamageList(log, phase.Start, phase.End, null),
                        Targets = new List <IReadOnlyList <int> >()
                    },
                    BreakbarDamage = new PlayerDamageChartDto <double>()
                    {
                        Total   = p.Get1SBreakbarDamageList(log, phase.Start, phase.End, null),
                        Targets = new List <IReadOnlyList <double> >()
                    },
                    HealthStates  = ChartDataDto.BuildHealthStates(log, p, phase, true),
                    BarrierStates = ChartDataDto.BuildBarrierStates(log, p, phase)
                };
                foreach (NPC target in phase.Targets)
                {
                    pChar.Damage.Targets.Add(p.Get1SDamageList(log, phase.Start, phase.End, target));
                    pChar.BreakbarDamage.Targets.Add(p.Get1SBreakbarDamageList(log, phase.Start, phase.End, target));
                }
                list.Add(pChar);
            }
            return(list);
        }
 public PhaseChartDataDto(ParsedEvtcLog log, PhaseData phase, bool addCRData)
 {
     Players = PlayerChartDataDto.BuildPlayersGraphData(log, phase);
     foreach (AbstractSingleActor target in phase.Targets)
     {
         Targets.Add(new TargetChartDataDto(log, phase, target));
     }
     if (addCRData)
     {
         TargetsHealthStatesForCR          = new List <List <object[]> >();
         TargetsBreakbarPercentStatesForCR = new List <List <object[]> >();
         TargetsBarrierStatesForCR         = new List <List <object[]> >();
         foreach (AbstractSingleActor target in log.FightData.Logic.Targets)
         {
             TargetsHealthStatesForCR.Add(ChartDataDto.BuildHealthStates(log, target, phase, false));
             TargetsBreakbarPercentStatesForCR.Add(ChartDataDto.BuildBreakbarPercentStates(log, target, phase));
             TargetsBarrierStatesForCR.Add(ChartDataDto.BuildBarrierStates(log, target, phase));
         }
     }
 }
        internal static List <PlayerChartDataDto> BuildPlayersGraphData(ParsedEvtcLog log, int phaseIndex)
        {
            var       list  = new List <PlayerChartDataDto>();
            PhaseData phase = log.FightData.GetPhases(log)[phaseIndex];

            foreach (Player p in log.PlayerList)
            {
                var pChar = new PlayerChartDataDto()
                {
                    Total        = p.Get1SDamageList(log, phaseIndex, phase, null),
                    Targets      = new List <List <int> >(),
                    HealthStates = ChartDataDto.BuildHealthGraphStates(log, p, log.FightData.GetPhases(log)[phaseIndex], true)
                };
                foreach (NPC target in phase.Targets)
                {
                    pChar.Targets.Add(p.Get1SDamageList(log, phaseIndex, phase, target));
                }
                list.Add(pChar);
            }
            return(list);
        }