mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 07:06:35 +09:00
Add xmldocs / cleanup
This commit is contained in:
@ -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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user