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();
        }
Example #2
0
        public override void Update(int?displayIndex = null)
        {
            PercentOfTotal = Settings.Default.IncludeTopLevelNPCRows
                ? FightCharacter.PercentPlusPetsOfFightsTotalDamageDone
                : FightCharacter.PercentPlusPetsOfFightsTotalPlayerDamageDonePlusPets;
            PercentOfMax = Settings.Default.IncludeTopLevelNPCRows
                ? FightCharacter.PercentPlusPetsOfFightsMaxDamageDonePlusPets
                : FightCharacter.PercentPlusPetsOfFightsMaxPlayerDamageDonePlusPets;
            RightText = $"{FightCharacter.TotalDamageDonePlusPets.Format()} ({FightCharacter.TotalDamageDonePMPlusPets.Format()}, {DisplayedPercent.FormatPercent()})";

            if (FightCharacter.IsFightPetMaster)
            {
                int detailRowDisplayIndex = 1;
                foreach (var fightCharacter in new[] { FightCharacter }.Concat(FightCharacter.FightPets)
                         .OrderByDescending(c => c.TotalDamageDone)
                         .ThenBy(c => c.UncoloredName))
                {
                    if (!_detailRowMap.TryGetValue(fightCharacter, out DetailRowBase detailRow))
                    {
                        _detailRowMap.Add(fightCharacter, detailRow = new DamageDoneDetailRow(FightViewModel, fightCharacter));
                        DetailRows.Add(detailRow);
                    }
                    detailRow.Update(detailRowDisplayIndex++);
                }
            }

            CleanUpOldPetDetailRowsIfNecessary(FightCharacter);

            base.Update(displayIndex);
        }
Example #3
0
 /// <summary>
 /// 明细行功能中切换行状态时调用此方法
 /// </summary>
 /// <param name="item"></param>
 protected EventCallback <MouseEventArgs> ExpandDetailRow(TItem item) => EventCallback.Factory.Create <MouseEventArgs>(this, () =>
 {
     DetailRows.Add(item);
     if (ExpandRows.Contains(item))
     {
         ExpandRows.Remove(item);
     }
     else
     {
         ExpandRows.Add(item);
     }
 });
 /// <summary>
 /// 明细行功能中切换行状态时调用此方法
 /// </summary>
 /// <param name="item"></param>
 public void ExpandDetailRow(TItem item)
 {
     DetailRows.Add(item);
     if (ExpandRows.Contains(item))
     {
         ExpandRows.Remove(item);
     }
     else
     {
         ExpandRows.Add(item);
     }
 }
Example #5
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();
        }
Example #6
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();
        }
Example #7
0
 /// <summary>
 /// 明细行首小图标单元格样式
 /// </summary>
 protected string?GetDetailBarClassString(TItem item) => CssBuilder.Default("table-cell is-bar")
 .AddClass("is-load", DetailRows.Contains(item))
 .Build();