public override void Update(int?displayIndex = null)
        {
            RightText = Settings.Default.IncludeTopLevelNPCRows
                ? $"{Fight.TotalDamageDone.Format()} ({Fight.TotalDamageDonePM.Format()})"
                : $"{Fight.TotalPlayerDamageDonePlusPets.Format()} ({Fight.TotalPlayerDamageDonePMPlusPets.Format()})";

            var topFightCharacters = Fight.FightCharacters
                                     .Where(c => (Settings.Default.IncludeTopLevelNPCRows || c.IsPlayerOrFightPet) &&
                                            (Settings.Default.IncludeTopLevelZeroDamageRows || c.TotalDamageDonePlusPets != 0))
                                     .Where(c => !c.IsFightPet)
                                     .OrderByDescending(c => c.TotalDamageDonePlusPets)
                                     .ThenBy(c => c.UncoloredName)
                                     .Take(Settings.Default.MaxNumberOfDetailRows).ToArray();

            foreach (var noLongerTopFightCharacter in _detailRowMap.Keys
                     .Except(topFightCharacters).ToArray())
            {
                DetailRows.Remove(_detailRowMap[noLongerTopFightCharacter]);
                _detailRowMap.Remove(noLongerTopFightCharacter);
            }

            int detailRowDisplayIndex = 1;

            foreach (var fightCharacter in topFightCharacters)
            {
                if (!_detailRowMap.TryGetValue(fightCharacter, out DetailRowBase detailRow))
                {
                    _detailRowMap.Add(fightCharacter, detailRow = new DamageDoneViewingModeDetailRow(FightViewModel, fightCharacter));
                    DetailRows.Add(detailRow);
                }
                detailRow.Update(detailRowDisplayIndex++);
            }

            base.Update();
        }
Ejemplo n.º 2
0
        public override void Update(int?displayIndex = null)
        {
            if (FightOwner == null)
            {
                RightText = $"{EmDash} ({EmDash})";
            }
            else
            {
                RightText = $"{FightOwner.PotentialHealingTaken.Format()} ({FightOwner.PotentialHealingTakenPM.Format()})";

                var topHealingTakenInfos = FightOwner.HealingTakenInfos
                                           .Where(i => !i.Source.IsFightPet)
                                           .OrderByDescending(i => i.PotentialHealingPlusPets)
                                           .ThenBy(i => i.Source.UncoloredName)
                                           .Take(Settings.Default.MaxNumberOfDetailRows).ToArray();

                foreach (var noLongerTopHealingTakenSource in _detailRowMap.Keys
                         .Except(topHealingTakenInfos.Select(i => i.Source)).ToArray())
                {
                    DetailRows.Remove(_detailRowMap[noLongerTopHealingTakenSource]);
                    _detailRowMap.Remove(noLongerTopHealingTakenSource);
                }

                int detailRowDisplayIndex = 1;
                foreach (var healingTakenInfo in topHealingTakenInfos)
                {
                    if (!_detailRowMap.TryGetValue(healingTakenInfo.Source, out DetailRowBase detailRow))
                    {
                        _detailRowMap.Add(healingTakenInfo.Source, detailRow = new OwnersHealingTakenViewingModeDetailRow(FightViewModel, healingTakenInfo));
                        DetailRows.Add(detailRow);
                    }
                    detailRow.Update(detailRowDisplayIndex++);
                }
            }

            base.Update();
        }
Ejemplo n.º 3
0
        public override void Update(int?displayIndex = null)
        {
            if (FightOwner == null)
            {
                RightText = $"{EmDash} ({EmDash}, {EmDash})";
            }
            else
            {
                RightText = $"{FightOwner.CastSuccesses:N0} ({FightOwner.CastSuccessesPM.Format()}, {FightOwner.CastSuccessChance.FormatPercent()})";

                var topCastInfos = FightOwner.CastInfos
                                   .OrderByDescending(i => i.CastSuccesses)
                                   .ThenBy(i => i.NanoProgram)
                                   .Take(Settings.Default.MaxNumberOfDetailRows).ToArray();

                foreach (var noLongerTopCastInfo in _detailRowMap.Keys
                         .Except(topCastInfos).ToArray())
                {
                    DetailRows.Remove(_detailRowMap[noLongerTopCastInfo]);
                    _detailRowMap.Remove(noLongerTopCastInfo);
                }

                int detailRowDisplayIndex = 1;
                foreach (var castInfo in topCastInfos)
                {
                    if (!_detailRowMap.TryGetValue(castInfo, out DetailRowBase detailRow))
                    {
                        _detailRowMap.Add(castInfo, detailRow = new OwnersCastsViewingModeDetailRow(FightViewModel, castInfo));
                        DetailRows.Add(detailRow);
                    }
                    detailRow.Update(detailRowDisplayIndex++);
                }
            }

            base.Update();
        }