mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 09:02:58 +08:00
Add xmldocs / cleanup
This commit is contained in:
parent
1521f25c96
commit
2ee480f1d8
@ -20,6 +20,9 @@ using osuTK;
|
||||
|
||||
namespace osu.Game.Screens.Ranking.Expanded
|
||||
{
|
||||
/// <summary>
|
||||
/// The content that appears in the middle section of the <see cref="ScorePanel"/>.
|
||||
/// </summary>
|
||||
public class ExpandedPanelMiddleContent : CompositeDrawable
|
||||
{
|
||||
private readonly ScoreInfo score;
|
||||
@ -27,6 +30,10 @@ namespace osu.Game.Screens.Ranking.Expanded
|
||||
private readonly List<StatisticDisplay> statisticDisplays = new List<StatisticDisplay>();
|
||||
private RollingCounter<long> scoreCounter;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="ExpandedPanelMiddleContent"/>.
|
||||
/// </summary>
|
||||
/// <param name="score">The score to display.</param>
|
||||
public ExpandedPanelMiddleContent(ScoreInfo score)
|
||||
{
|
||||
this.score = score;
|
||||
|
@ -15,10 +15,17 @@ using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Screens.Ranking.Expanded
|
||||
{
|
||||
/// <summary>
|
||||
/// A pill that displays the star rating of a <see cref="BeatmapInfo"/>.
|
||||
/// </summary>
|
||||
public class StarRatingDisplay : CompositeDrawable
|
||||
{
|
||||
private readonly BeatmapInfo beatmap;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="StarRatingDisplay"/>.
|
||||
/// </summary>
|
||||
/// <param name="beatmap">The <see cref="BeatmapInfo"/> to display the star difficulty of.</param>
|
||||
public StarRatingDisplay(BeatmapInfo beatmap)
|
||||
{
|
||||
this.beatmap = beatmap;
|
||||
|
@ -10,12 +10,19 @@ using osuTK;
|
||||
|
||||
namespace osu.Game.Screens.Ranking.Expanded.Statistics
|
||||
{
|
||||
/// <summary>
|
||||
/// A <see cref="StatisticDisplay"/> to display the player's accuracy.
|
||||
/// </summary>
|
||||
public class AccuracyStatistic : StatisticDisplay
|
||||
{
|
||||
private readonly double accuracy;
|
||||
|
||||
private RollingCounter<double> counter;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="AccuracyStatistic"/>.
|
||||
/// </summary>
|
||||
/// <param name="accuracy">The accuracy to display.</param>
|
||||
public AccuracyStatistic(double accuracy)
|
||||
: base("accuracy")
|
||||
{
|
||||
|
@ -12,12 +12,20 @@ using osuTK;
|
||||
|
||||
namespace osu.Game.Screens.Ranking.Expanded.Statistics
|
||||
{
|
||||
/// <summary>
|
||||
/// A <see cref="StatisticDisplay"/> to display the player's combo.
|
||||
/// </summary>
|
||||
public class ComboStatistic : CounterStatistic
|
||||
{
|
||||
private readonly bool isPerfect;
|
||||
|
||||
private Drawable perfectText;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="ComboStatistic"/>.
|
||||
/// </summary>
|
||||
/// <param name="combo">The combo to be displayed.</param>
|
||||
/// <param name="isPerfect">Whether this is a perfect combo.</param>
|
||||
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,
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -9,12 +9,20 @@ using osuTK;
|
||||
|
||||
namespace osu.Game.Screens.Ranking.Expanded.Statistics
|
||||
{
|
||||
/// <summary>
|
||||
/// A <see cref="StatisticDisplay"/> to display general numeric values.
|
||||
/// </summary>
|
||||
public class CounterStatistic : StatisticDisplay
|
||||
{
|
||||
private readonly int count;
|
||||
|
||||
private RollingCounter<int> counter;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="CounterStatistic"/>.
|
||||
/// </summary>
|
||||
/// <param name="header">The name of the statistic.</param>
|
||||
/// <param name="count">The value to display.</param>
|
||||
public CounterStatistic(string header, int count)
|
||||
: base(header)
|
||||
{
|
||||
|
@ -11,12 +11,19 @@ using osu.Game.Graphics.Sprites;
|
||||
|
||||
namespace osu.Game.Screens.Ranking.Expanded.Statistics
|
||||
{
|
||||
/// <summary>
|
||||
/// A statistic from the score to be displayed in the <see cref="ExpandedPanelMiddleContent"/>.
|
||||
/// </summary>
|
||||
public abstract class StatisticDisplay : CompositeDrawable
|
||||
{
|
||||
private readonly string header;
|
||||
|
||||
private Drawable content;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="StatisticDisplay"/>.
|
||||
/// </summary>
|
||||
/// <param name="header">The name of the statistic.</param>
|
||||
protected StatisticDisplay(string header)
|
||||
{
|
||||
this.header = header;
|
||||
@ -75,8 +82,14 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the statistic value.
|
||||
/// </summary>
|
||||
public virtual void Appear() => content.FadeIn(100);
|
||||
|
||||
/// <summary>
|
||||
/// Creates the content for this <see cref="StatisticDisplay"/>.
|
||||
/// </summary>
|
||||
protected abstract Drawable CreateContent();
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,9 @@ using osuTK;
|
||||
|
||||
namespace osu.Game.Screens.Ranking.Expanded
|
||||
{
|
||||
/// <summary>
|
||||
/// A counter for the player's total score to be displayed in the <see cref="ExpandedPanelMiddleContent"/>.
|
||||
/// </summary>
|
||||
public class TotalScoreCounter : RollingCounter<long>
|
||||
{
|
||||
protected override double RollingDuration => AccuracyCircle.ACCURACY_TRANSFORM_DURATION;
|
||||
|
Loading…
Reference in New Issue
Block a user