コード例 #1
0
        // 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);
        }
コード例 #2
0
 public PlayerDto(AbstractSingleActor actor, ParsedEvtcLog log, ActorDetailsDto details) : base(actor, log, details)
 {
     Group       = actor.Group;
     Acc         = actor.Account;
     Profession  = actor.Spec.ToString();
     IsPoV       = log.LogData.PoV == actor.AgentItem;
     IsCommander = actor is Player p && p.IsCommander(log);
     (ColTarget, ColCleave, ColTotal) = GetSpecGraphColor(actor.BaseSpec);
     IsFake     = actor.IsFakeActor;
     NotInSquad = !(actor is Player);
     BuildWeaponSets(actor, log);
 }
コード例 #3
0
 public PlayerDto(AbstractSingleActor actor, ParsedEvtcLog log, ActorDetailsDto details) : base(actor, log, details)
 {
     Group       = actor.Group;
     Acc         = actor.Account;
     Profession  = actor.Spec.ToString();
     IsPoV       = log.LogData.PoV == actor.AgentItem;
     IsCommander = actor.HasCommanderTag;
     ColTarget   = HTMLBuilder.GetLink("Color-" + actor.Spec.ToString());
     ColCleave   = HTMLBuilder.GetLink("Color-" + actor.Spec.ToString() + "-NonBoss");
     ColTotal    = HTMLBuilder.GetLink("Color-" + actor.Spec.ToString() + "-Total");
     IsFake      = actor.IsFakeActor;
     NotInSquad  = !(actor is Player);
     BuildWeaponSets(actor, log);
 }
コード例 #4
0
        public static ActorDetailsDto BuildTargetData(ParsedEvtcLog log, AbstractSingleActor target, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs, bool cr)
        {
            var dto = new ActorDetailsDto
            {
                DmgDistributions      = new List <DmgDistributionDto>(),
                DmgDistributionsTaken = new List <DmgDistributionDto>(),
                BoonGraph             = new List <List <BuffChartDataDto> >(),
                Rotation = new List <List <object[]> >()
            };
            IReadOnlyList <PhaseData> phases = log.FightData.GetPhases(log);

            for (int i = 0; i < phases.Count; i++)
            {
                PhaseData phase = phases[i];
                if (phase.Targets.Contains(target))
                {
                    dto.DmgDistributions.Add(DmgDistributionDto.BuildTargetDMGDistData(log, target, phase, usedSkills, usedBuffs));
                    dto.DmgDistributionsTaken.Add(DmgDistributionDto.BuildDMGTakenDistData(log, target, phase, usedSkills, usedBuffs));
                    dto.Rotation.Add(SkillDto.BuildRotationData(log, target, phase, usedSkills));
                    dto.BoonGraph.Add(BuffChartDataDto.BuildBoonGraphData(log, target, phase, usedBuffs));
                }
                // rotation + buff graph for CR
                else if (i == 0 && cr)
                {
                    dto.DmgDistributions.Add(new DmgDistributionDto());
                    dto.DmgDistributionsTaken.Add(new DmgDistributionDto());
                    dto.Rotation.Add(SkillDto.BuildRotationData(log, target, phase, usedSkills));
                    dto.BoonGraph.Add(BuffChartDataDto.BuildBoonGraphData(log, target, phase, usedBuffs));
                }
                else
                {
                    dto.DmgDistributions.Add(new DmgDistributionDto());
                    dto.DmgDistributionsTaken.Add(new DmgDistributionDto());
                    dto.Rotation.Add(new List <object[]>());
                    dto.BoonGraph.Add(new List <BuffChartDataDto>());
                }
            }

            dto.Minions = new List <ActorDetailsDto>();
            foreach (KeyValuePair <long, Minions> pair in target.GetMinions(log))
            {
                dto.Minions.Add(BuildTargetsMinionsData(log, target, pair.Value, usedSkills, usedBuffs));
            }
            return(dto);
        }
コード例 #5
0
 public TargetDto(AbstractSingleActor target, ParsedEvtcLog log, ActorDetailsDto details) : base(target, log, details)
 {
     HbHeight = target.HitboxHeight;
     HbWidth  = target.HitboxWidth;
     HpLeft   = 100.0;
     if (log.FightData.Success)
     {
         HpLeft = 0;
     }
     else
     {
         IReadOnlyList <HealthUpdateEvent> hpUpdates = log.CombatData.GetHealthUpdateEvents(target.AgentItem);
         if (hpUpdates.Count > 0)
         {
             HpLeft = hpUpdates.Last().HPPercent;
         }
     }
     Percent = Math.Round(100.0 - HpLeft, 2);
 }
コード例 #6
0
 protected ActorDto(AbstractSingleActor actor, ParsedEvtcLog log, ActorDetailsDto details)
 {
     Health   = actor.GetHealth(log.CombatData);
     Condi    = actor.Condition;
     Conc     = actor.Concentration;
     Heal     = actor.Healing;
     Icon     = actor.GetIcon();
     Name     = actor.Character;
     Tough    = actor.Toughness;
     Details  = details;
     UniqueID = actor.UniqueID;
     foreach (KeyValuePair <long, Minions> pair in actor.GetMinions(log))
     {
         Minions.Add(new MinionDto()
         {
             Id   = pair.Key,
             Name = pair.Value.Character
         });
     }
 }
コード例 #7
0
        private static ActorDetailsDto BuildFriendlyMinionsData(ParsedEvtcLog log, AbstractSingleActor actor, Minions minion, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs)
        {
            var dto = new ActorDetailsDto
            {
                DmgDistributions        = new List <DmgDistributionDto>(),
                DmgDistributionsTargets = new List <List <DmgDistributionDto> >()
            };

            foreach (PhaseData phase in log.FightData.GetPhases(log))
            {
                var dmgTargetsDto = new List <DmgDistributionDto>();
                foreach (AbstractSingleActor target in phase.Targets)
                {
                    dmgTargetsDto.Add(DmgDistributionDto.BuildFriendlyMinionDMGDistData(log, actor, minion, target, phase, usedSkills, usedBuffs));
                }
                dto.DmgDistributionsTargets.Add(dmgTargetsDto);
                dto.DmgDistributions.Add(DmgDistributionDto.BuildFriendlyMinionDMGDistData(log, actor, minion, null, phase, usedSkills, usedBuffs));
            }
            return(dto);
        }
コード例 #8
0
        private static ActorDetailsDto BuildTargetsMinionsData(ParsedEvtcLog log, AbstractSingleActor target, Minions minion, Dictionary <long, SkillItem> usedSkills, Dictionary <long, Buff> usedBuffs)
        {
            var dto = new ActorDetailsDto
            {
                DmgDistributions = new List <DmgDistributionDto>()
            };

            foreach (PhaseData phase in log.FightData.GetPhases(log))
            {
                if (phase.Targets.Contains(target))
                {
                    dto.DmgDistributions.Add(DmgDistributionDto.BuildTargetMinionDMGDistData(log, target, minion, phase, usedSkills, usedBuffs));
                }
                else
                {
                    dto.DmgDistributions.Add(new DmgDistributionDto());
                }
            }
            return(dto);
        }