From eddf45329445f8b43cb37b65cbeaa3d3bce0f332 Mon Sep 17 00:00:00 2001 From: Henry Lin Date: Mon, 17 Jan 2022 21:32:13 +0800 Subject: [PATCH] Fix code quality issues --- osu.Game/Rulesets/Difficulty/PerformanceDisplayAttribute.cs | 1 + .../Ranking/Expanded/Statistics/PerformanceStatistic.cs | 6 ++---- .../Expanded/Statistics/PerformanceStatisticTooltip.cs | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Rulesets/Difficulty/PerformanceDisplayAttribute.cs b/osu.Game/Rulesets/Difficulty/PerformanceDisplayAttribute.cs index e95cb03053..7958bc174e 100644 --- a/osu.Game/Rulesets/Difficulty/PerformanceDisplayAttribute.cs +++ b/osu.Game/Rulesets/Difficulty/PerformanceDisplayAttribute.cs @@ -1,5 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. + namespace osu.Game.Rulesets.Difficulty { /// diff --git a/osu.Game/Screens/Ranking/Expanded/Statistics/PerformanceStatistic.cs b/osu.Game/Screens/Ranking/Expanded/Statistics/PerformanceStatistic.cs index 888552e568..4fd6964a68 100644 --- a/osu.Game/Screens/Ranking/Expanded/Statistics/PerformanceStatistic.cs +++ b/osu.Game/Screens/Ranking/Expanded/Statistics/PerformanceStatistic.cs @@ -24,8 +24,6 @@ public class PerformanceStatistic : StatisticDisplay, IHasCustomTooltip counter; - private PerformanceAttributes attributes; - public PerformanceStatistic(ScoreInfo score) : base("PP") { @@ -43,7 +41,7 @@ private void setPerformanceValue(PerformanceAttributes pp) { if (pp != null) { - attributes = pp; + TooltipContent = pp; performance.Value = (int)Math.Round(pp.Total, MidpointRounding.AwayFromZero); } } @@ -68,6 +66,6 @@ protected override void Dispose(bool isDisposing) public ITooltip GetCustomTooltip() => new PerformanceStatisticTooltip(); - public PerformanceAttributes TooltipContent => attributes; + public PerformanceAttributes TooltipContent { get; private set; } } } diff --git a/osu.Game/Screens/Ranking/Expanded/Statistics/PerformanceStatisticTooltip.cs b/osu.Game/Screens/Ranking/Expanded/Statistics/PerformanceStatisticTooltip.cs index ab7156e0c5..e0bbf91381 100644 --- a/osu.Game/Screens/Ranking/Expanded/Statistics/PerformanceStatisticTooltip.cs +++ b/osu.Game/Screens/Ranking/Expanded/Statistics/PerformanceStatisticTooltip.cs @@ -1,5 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. + using System; using System.Globalization; using System.Linq;