From 2ee480f1d8aaaec127856a7f0a8234238c9391fa Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 17 Mar 2020 17:34:16 +0900 Subject: [PATCH] Add xmldocs / cleanup --- .../Expanded/ExpandedPanelMiddleContent.cs | 7 +++ .../Ranking/Expanded/StarRatingDisplay.cs | 7 +++ .../Expanded/Statistics/AccuracyStatistic.cs | 7 +++ .../Expanded/Statistics/ComboStatistic.cs | 51 ++++++++++--------- .../Expanded/Statistics/CounterStatistic.cs | 8 +++ .../Expanded/Statistics/StatisticDisplay.cs | 13 +++++ .../Ranking/Expanded/TotalScoreCounter.cs | 3 ++ 7 files changed, 73 insertions(+), 23 deletions(-) diff --git a/osu.Game/Screens/Ranking/Expanded/ExpandedPanelMiddleContent.cs b/osu.Game/Screens/Ranking/Expanded/ExpandedPanelMiddleContent.cs index 4f45b1c5d7..6d5d7e0d95 100644 --- a/osu.Game/Screens/Ranking/Expanded/ExpandedPanelMiddleContent.cs +++ b/osu.Game/Screens/Ranking/Expanded/ExpandedPanelMiddleContent.cs @@ -20,6 +20,9 @@ using osuTK; namespace osu.Game.Screens.Ranking.Expanded { + /// + /// The content that appears in the middle section of the . + /// public class ExpandedPanelMiddleContent : CompositeDrawable { private readonly ScoreInfo score; @@ -27,6 +30,10 @@ namespace osu.Game.Screens.Ranking.Expanded private readonly List statisticDisplays = new List(); private RollingCounter scoreCounter; + /// + /// Creates a new . + /// + /// The score to display. public ExpandedPanelMiddleContent(ScoreInfo score) { this.score = score; diff --git a/osu.Game/Screens/Ranking/Expanded/StarRatingDisplay.cs b/osu.Game/Screens/Ranking/Expanded/StarRatingDisplay.cs index 87d9828707..74b58b9f8c 100644 --- a/osu.Game/Screens/Ranking/Expanded/StarRatingDisplay.cs +++ b/osu.Game/Screens/Ranking/Expanded/StarRatingDisplay.cs @@ -15,10 +15,17 @@ using osuTK.Graphics; namespace osu.Game.Screens.Ranking.Expanded { + /// + /// A pill that displays the star rating of a . + /// public class StarRatingDisplay : CompositeDrawable { private readonly BeatmapInfo beatmap; + /// + /// Creates a new . + /// + /// The to display the star difficulty of. public StarRatingDisplay(BeatmapInfo beatmap) { this.beatmap = beatmap; diff --git a/osu.Game/Screens/Ranking/Expanded/Statistics/AccuracyStatistic.cs b/osu.Game/Screens/Ranking/Expanded/Statistics/AccuracyStatistic.cs index 2f7fc3a4fd..2a0e33aab7 100644 --- a/osu.Game/Screens/Ranking/Expanded/Statistics/AccuracyStatistic.cs +++ b/osu.Game/Screens/Ranking/Expanded/Statistics/AccuracyStatistic.cs @@ -10,12 +10,19 @@ using osuTK; namespace osu.Game.Screens.Ranking.Expanded.Statistics { + /// + /// A to display the player's accuracy. + /// public class AccuracyStatistic : StatisticDisplay { private readonly double accuracy; private RollingCounter counter; + /// + /// Creates a new . + /// + /// The accuracy to display. public AccuracyStatistic(double accuracy) : base("accuracy") { diff --git a/osu.Game/Screens/Ranking/Expanded/Statistics/ComboStatistic.cs b/osu.Game/Screens/Ranking/Expanded/Statistics/ComboStatistic.cs index ce5a15da01..e13138c5a0 100644 --- a/osu.Game/Screens/Ranking/Expanded/Statistics/ComboStatistic.cs +++ b/osu.Game/Screens/Ranking/Expanded/Statistics/ComboStatistic.cs @@ -12,12 +12,20 @@ using osuTK; namespace osu.Game.Screens.Ranking.Expanded.Statistics { + /// + /// A to display the player's combo. + /// public class ComboStatistic : CounterStatistic { private readonly bool isPerfect; private Drawable perfectText; + /// + /// Creates a new . + /// + /// The combo to be displayed. + /// Whether this is a perfect combo. public ComboStatistic(int combo, bool isPerfect) : base("combo", combo) { @@ -35,32 +43,29 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics } } - protected override Drawable CreateContent() + protected override Drawable CreateContent() => new FillFlowContainer { - return new FillFlowContainer + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Horizontal, + Spacing = new Vector2(10, 0), + Children = new[] { - AutoSizeAxes = Axes.Both, - Direction = FillDirection.Horizontal, - Spacing = new Vector2(10, 0), - Children = new[] + base.CreateContent().With(d => { - base.CreateContent().With(d => - { - Anchor = Anchor.CentreLeft; - Origin = Anchor.CentreLeft; - }), - perfectText = new OsuSpriteText - { - Anchor = Anchor.CentreLeft, - Origin = Anchor.CentreLeft, - Text = "PERFECT", - Font = OsuFont.Torus.With(size: 11, weight: FontWeight.SemiBold), - Colour = ColourInfo.GradientVertical(Color4Extensions.FromHex("#66FFCC"), Color4Extensions.FromHex("#FF9AD7")), - Alpha = 0, - UseFullGlyphHeight = false, - } + Anchor = Anchor.CentreLeft; + Origin = Anchor.CentreLeft; + }), + perfectText = new OsuSpriteText + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + Text = "PERFECT", + Font = OsuFont.Torus.With(size: 11, weight: FontWeight.SemiBold), + Colour = ColourInfo.GradientVertical(Color4Extensions.FromHex("#66FFCC"), Color4Extensions.FromHex("#FF9AD7")), + Alpha = 0, + UseFullGlyphHeight = false, } - }; - } + } + }; } } diff --git a/osu.Game/Screens/Ranking/Expanded/Statistics/CounterStatistic.cs b/osu.Game/Screens/Ranking/Expanded/Statistics/CounterStatistic.cs index ee07ea326d..817cc9b8c2 100644 --- a/osu.Game/Screens/Ranking/Expanded/Statistics/CounterStatistic.cs +++ b/osu.Game/Screens/Ranking/Expanded/Statistics/CounterStatistic.cs @@ -9,12 +9,20 @@ using osuTK; namespace osu.Game.Screens.Ranking.Expanded.Statistics { + /// + /// A to display general numeric values. + /// public class CounterStatistic : StatisticDisplay { private readonly int count; private RollingCounter counter; + /// + /// Creates a new . + /// + /// The name of the statistic. + /// The value to display. public CounterStatistic(string header, int count) : base(header) { diff --git a/osu.Game/Screens/Ranking/Expanded/Statistics/StatisticDisplay.cs b/osu.Game/Screens/Ranking/Expanded/Statistics/StatisticDisplay.cs index 55015b432b..a653cc82d4 100644 --- a/osu.Game/Screens/Ranking/Expanded/Statistics/StatisticDisplay.cs +++ b/osu.Game/Screens/Ranking/Expanded/Statistics/StatisticDisplay.cs @@ -11,12 +11,19 @@ using osu.Game.Graphics.Sprites; namespace osu.Game.Screens.Ranking.Expanded.Statistics { + /// + /// A statistic from the score to be displayed in the . + /// public abstract class StatisticDisplay : CompositeDrawable { private readonly string header; private Drawable content; + /// + /// Creates a new . + /// + /// The name of the statistic. protected StatisticDisplay(string header) { this.header = header; @@ -75,8 +82,14 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics }; } + /// + /// Shows the statistic value. + /// public virtual void Appear() => content.FadeIn(100); + /// + /// Creates the content for this . + /// protected abstract Drawable CreateContent(); } } diff --git a/osu.Game/Screens/Ranking/Expanded/TotalScoreCounter.cs b/osu.Game/Screens/Ranking/Expanded/TotalScoreCounter.cs index d230e56649..cab04edb8b 100644 --- a/osu.Game/Screens/Ranking/Expanded/TotalScoreCounter.cs +++ b/osu.Game/Screens/Ranking/Expanded/TotalScoreCounter.cs @@ -9,6 +9,9 @@ using osuTK; namespace osu.Game.Screens.Ranking.Expanded { + /// + /// A counter for the player's total score to be displayed in the . + /// public class TotalScoreCounter : RollingCounter { protected override double RollingDuration => AccuracyCircle.ACCURACY_TRANSFORM_DURATION;