public TargetDto(Target target, ParsedLog log, bool cr, ActorDetailsDto details) { Name = target.Character; Icon = GeneralHelper.GetNPCIcon(target.ID); Health = target.GetHealth(log.CombatData); HbHeight = target.HitboxHeight; HbWidth = target.HitboxWidth; Tough = target.Toughness; Details = details; if (cr) { CombatReplayID = target.GetCombatReplayID(log); } if (log.FightData.Success) { HpLeft = 0; } else { List <HealthUpdateEvent> hpUpdates = log.CombatData.GetHealthUpdateEvents(target.AgentItem); if (hpUpdates.Count > 0) { HpLeft = hpUpdates.Last().HPPercent; } } Percent = Math.Round(100.0 - HpLeft, 2); foreach (KeyValuePair <string, Minions> pair in target.GetMinions(log)) { Minions.Add(new MinionDto() { Id = pair.Value.MinionID, Name = pair.Key.TrimEnd(" \0".ToArray()) }); } }
public PlayerDto(Player player, ParsedLog log, bool cr, ActorDetailsDto details) { Group = player.Group; Name = player.Character; Acc = player.Account; Profession = player.Prof; Condi = player.Condition; Conc = player.Concentration; Heal = player.Healing; Tough = player.Toughness; ColTarget = GeneralHelper.GetLink("Color-" + player.Prof); ColCleave = GeneralHelper.GetLink("Color-" + player.Prof + "-NonBoss"); ColTotal = GeneralHelper.GetLink("Color-" + player.Prof + "-Total"); IsConjure = (player.IsFakeActor); BuildWeaponSets(player, log); Details = details; if (cr && !IsConjure) { CombatReplayID = player.GetCombatReplayID(log); } foreach (KeyValuePair <string, Minions> pair in player.GetMinions(log)) { Minions.Add(new MinionDto() { Id = pair.Value.MinionID, Name = pair.Key.TrimEnd(" \0".ToArray()) }); } }