1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-20 05:03:20 +08:00

Use more sensible names for classes and methods

Adds xmldoc in places too.
This commit is contained in:
Dean Herbert 2017-12-11 12:31:35 +09:00
parent 507d0e3252
commit 98ce856de1
7 changed files with 19 additions and 13 deletions

View File

@ -15,7 +15,7 @@ namespace osu.Game.Tests.Visual
{
internal class TestCaseHistoricalSection : OsuTestCase
{
public override IReadOnlyList<Type> RequiredTypes => new [] { typeof(HistoricalSection), typeof(PaginatedMostPlayedBeatmapContainer), typeof(MostPlayedBeatmapDrawable) };
public override IReadOnlyList<Type> RequiredTypes => new [] { typeof(HistoricalSection), typeof(PaginatedMostPlayedBeatmapContainer), typeof(DrawableMostPlayedRow) };
public TestCaseHistoricalSection()
{

View File

@ -11,6 +11,9 @@ using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays.Profile.Sections
{
/// <summary>
/// Display artist/title/mapper information, commonly used as the left portion of a profile or score display row (see <see cref="DrawableProfileRow"/>).
/// </summary>
public class BeatmapMetadataContainer : OsuHoverContainer, IHasTooltip
{
private readonly BeatmapInfo beatmap;

View File

@ -13,7 +13,7 @@ using OpenTK.Graphics;
namespace osu.Game.Overlays.Profile.Sections
{
public abstract class DrawableBeatmapRow : Container
public abstract class DrawableProfileRow : Container
{
private const int fade_duration = 200;
@ -21,14 +21,17 @@ namespace osu.Game.Overlays.Profile.Sections
private readonly Box coloredBackground;
private readonly Container background;
protected abstract Drawable CreatePicture();
/// <summary>
/// A visual element displayed to the left of <see cref="LeftFlowContainer"/> content.
/// </summary>
protected abstract Drawable CreateLeftVisual();
protected FillFlowContainer LeftFlowContainer { get; private set; }
protected FillFlowContainer RightFlowContainer { get; private set; }
protected override Container<Drawable> Content { get; }
protected DrawableBeatmapRow()
protected DrawableProfileRow()
{
RelativeSizeAxes = Axes.X;
Height = 60;
@ -77,7 +80,7 @@ namespace osu.Game.Overlays.Profile.Sections
Direction = FillDirection.Horizontal,
Children = new[]
{
CreatePicture(),
CreateLeftVisual(),
LeftFlowContainer = new FillFlowContainer
{
RelativeSizeAxes = Axes.X,

View File

@ -14,19 +14,19 @@ using OpenTK.Graphics;
namespace osu.Game.Overlays.Profile.Sections.Historical
{
public class MostPlayedBeatmapDrawable : DrawableBeatmapRow
public class DrawableMostPlayedRow : DrawableProfileRow
{
private readonly BeatmapInfo beatmap;
private readonly int playCount;
private OsuHoverContainer mapperContainer;
public MostPlayedBeatmapDrawable(BeatmapInfo beatmap, int playCount)
public DrawableMostPlayedRow(BeatmapInfo beatmap, int playCount)
{
this.beatmap = beatmap;
this.playCount = playCount;
}
protected override Drawable CreatePicture() => new Container
protected override Drawable CreateLeftVisual() => new Container
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,

View File

@ -41,7 +41,7 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
foreach (var beatmap in beatmaps)
{
ItemsContainer.Add(new MostPlayedBeatmapDrawable(beatmap.GetBeatmapInfo(Rulesets), beatmap.PlayCount));
ItemsContainer.Add(new DrawableMostPlayedRow(beatmap.GetBeatmapInfo(Rulesets), beatmap.PlayCount));
}
};

View File

@ -14,7 +14,7 @@ using osu.Game.Rulesets.UI;
namespace osu.Game.Overlays.Profile.Sections.Ranks
{
public abstract class DrawableScore : DrawableBeatmapRow
public abstract class DrawableScore : DrawableProfileRow
{
private readonly FillFlowContainer metadata;
private readonly ScoreModsContainer modsContainer;
@ -65,7 +65,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
modsContainer.Add(new ModIcon(mod) { Scale = new Vector2(0.5f) });
}
protected override Drawable CreatePicture() => new DrawableRank(Score.Rank)
protected override Drawable CreateLeftVisual() => new DrawableRank(Score.Rank)
{
RelativeSizeAxes = Axes.Y,
Width = 60,

View File

@ -296,8 +296,8 @@
<Compile Include="Online\API\Requests\GetUserBeatmapsRequest.cs" />
<Compile Include="Overlays\Profile\Sections\BeatmapMetadataContainer.cs" />
<Compile Include="Overlays\Profile\Sections\Beatmaps\PaginatedBeatmapContainer.cs" />
<Compile Include="Overlays\Profile\Sections\DrawableBeatmapRow.cs" />
<Compile Include="Overlays\Profile\Sections\Historical\MostPlayedBeatmapDrawable.cs" />
<Compile Include="Overlays\Profile\Sections\DrawableProfileRow.cs" />
<Compile Include="Overlays\Profile\Sections\Historical\DrawableMostPlayedRow.cs" />
<Compile Include="Overlays\Profile\Sections\Historical\PaginatedMostPlayedBeatmapContainer.cs" />
<Compile Include="Overlays\Profile\Sections\Kudosu\KudosuInfo.cs" />
<Compile Include="Overlays\Profile\Sections\PaginatedContainer.cs" />