internal static List <DeathRecapDto> BuildDeathRecap(ParsedEvtcLog log, Player p) { var res = new List <DeathRecapDto>(); List <DeathRecap> recaps = p.GetDeathRecaps(log); if (!recaps.Any()) { return(null); } foreach (DeathRecap deathRecap in recaps) { var recap = new DeathRecapDto() { Time = deathRecap.DeathTime }; res.Add(recap); if (deathRecap.ToKill != null) { recap.ToKill = BuildDeathRecapItemList(deathRecap.ToKill); } if (deathRecap.ToDown != null) { recap.ToDown = BuildDeathRecapItemList(deathRecap.ToDown); } } return(res); }
// helpers public static ActorDetailsDto BuildPlayerData(ParsedEvtcLog log, AbstractSingleActor actor, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs) { var dto = new ActorDetailsDto { DmgDistributions = new List <DmgDistributionDto>(), DmgDistributionsTargets = new List <List <DmgDistributionDto> >(), DmgDistributionsTaken = new List <DmgDistributionDto>(), BoonGraph = new List <List <BuffChartDataDto> >(), Rotation = new List <List <object[]> >(), Food = FoodDto.BuildFoodData(log, actor, usedBuffs), Minions = new List <ActorDetailsDto>(), DeathRecap = DeathRecapDto.BuildDeathRecap(log, actor) }; foreach (PhaseData phase in log.FightData.GetPhases(log)) { dto.Rotation.Add(SkillDto.BuildRotationData(log, actor, phase, usedSkills)); dto.DmgDistributions.Add(DmgDistributionDto.BuildFriendlyDMGDistData(log, actor, null, phase, usedSkills, usedBuffs)); var dmgTargetsDto = new List <DmgDistributionDto>(); foreach (AbstractSingleActor target in phase.Targets) { dmgTargetsDto.Add(DmgDistributionDto.BuildFriendlyDMGDistData(log, actor, target, phase, usedSkills, usedBuffs)); } dto.DmgDistributionsTargets.Add(dmgTargetsDto); dto.DmgDistributionsTaken.Add(DmgDistributionDto.BuildDMGTakenDistData(log, actor, phase, usedSkills, usedBuffs)); dto.BoonGraph.Add(BuffChartDataDto.BuildBoonGraphData(log, actor, phase, usedBuffs)); } foreach (KeyValuePair <long, Minions> pair in actor.GetMinions(log)) { dto.Minions.Add(BuildFriendlyMinionsData(log, actor, pair.Value, usedSkills, usedBuffs)); } return(dto); }
// helpers internal static ActorDetailsDto BuildPlayerData(ParsedEvtcLog log, Player player, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs) { var dto = new ActorDetailsDto { DmgDistributions = new List <DmgDistributionDto>(), DmgDistributionsTargets = new List <List <DmgDistributionDto> >(), DmgDistributionsTaken = new List <DmgDistributionDto>(), BoonGraph = new List <List <BuffChartDataDto> >(), Rotation = new List <List <object[]> >(), Food = FoodDto.BuildPlayerFoodData(log, player, usedBuffs), Minions = new List <ActorDetailsDto>(), DeathRecap = DeathRecapDto.BuildDeathRecap(log, player) }; for (int i = 0; i < log.FightData.GetPhases(log).Count; i++) { dto.Rotation.Add(SkillDto.BuildRotationData(log, player, i, usedSkills)); dto.DmgDistributions.Add(DmgDistributionDto.BuildPlayerDMGDistData(log, player, null, i, usedSkills, usedBuffs)); var dmgTargetsDto = new List <DmgDistributionDto>(); foreach (NPC target in log.FightData.GetPhases(log)[i].Targets) { dmgTargetsDto.Add(DmgDistributionDto.BuildPlayerDMGDistData(log, player, target, i, usedSkills, usedBuffs)); } dto.DmgDistributionsTargets.Add(dmgTargetsDto); dto.DmgDistributionsTaken.Add(DmgDistributionDto.BuildDMGTakenDistData(log, player, i, usedSkills, usedBuffs)); dto.BoonGraph.Add(BuffChartDataDto.BuildBoonGraphData(log, player, i, usedBuffs)); } foreach (KeyValuePair <long, Minions> pair in player.GetMinions(log)) { dto.Minions.Add(BuildPlayerMinionsData(log, player, pair.Value, usedSkills, usedBuffs)); } return(dto); }
public static List <DeathRecapDto> BuildDeathRecap(ParsedEvtcLog log, AbstractSingleActor actor) { var res = new List <DeathRecapDto>(); IReadOnlyList <DeathRecap> recaps = actor.GetDeathRecaps(log); if (!recaps.Any()) { return(null); } foreach (DeathRecap deathRecap in recaps) { var recap = new DeathRecapDto() { Time = deathRecap.DeathTime }; res.Add(recap); if (deathRecap.ToKill != null) { recap.ToKill = BuildDeathRecapItemList(deathRecap.ToKill); } if (deathRecap.ToDown != null) { recap.ToDown = BuildDeathRecapItemList(deathRecap.ToDown); } } return(res); }