1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 20:03:22 +08:00

Clean-ups and renames

This commit is contained in:
Dean Herbert 2018-12-22 15:51:00 +09:00
parent daa6292e08
commit e404a0bc20
8 changed files with 24 additions and 22 deletions

View File

@ -15,10 +15,10 @@ namespace osu.Game.Screens.Play
{
}
protected override IEnumerable<IResultType> CreateResultTypes() => new IResultType[]
protected override IEnumerable<IResultPageInfo> CreateResultTypes() => new IResultPageInfo[]
{
new ScoreResultType(Score, Beatmap),
new RankingResultType(Score, Beatmap)
new ScoreOverviewPageInfo(Score, Beatmap),
new BeatmapLeaderboardPageInfo(Score, Beatmap)
};
}
}

View File

@ -2,14 +2,15 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Graphics;
using osu.Game.Screens.Ranking.Pages;
namespace osu.Game.Screens.Ranking.Types
namespace osu.Game.Screens.Ranking
{
public interface IResultType
public interface IResultPageInfo
{
FontAwesome Icon { get; }
string Name { get; }
ResultsPage CreatePage();
}
}

View File

@ -10,18 +10,17 @@ using osu.Game.Graphics;
using osuTK;
using osuTK.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Screens.Ranking.Types;
namespace osu.Game.Screens.Ranking
{
public class ResultModeButton : TabItem<IResultType>
public class ResultModeButton : TabItem<IResultPageInfo>
{
private readonly FontAwesome icon;
private Color4 activeColour;
private Color4 inactiveColour;
private CircularContainer colouredPart;
public ResultModeButton(IResultType mode)
public ResultModeButton(IResultPageInfo mode)
: base(mode)
{
icon = mode.Icon;

View File

@ -3,12 +3,11 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Screens.Ranking.Types;
using osuTK;
namespace osu.Game.Screens.Ranking
{
public class ResultModeTabControl : TabControl<IResultType>
public class ResultModeTabControl : TabControl<IResultPageInfo>
{
public ResultModeTabControl()
{
@ -20,9 +19,9 @@ namespace osu.Game.Screens.Ranking
TabContainer.Padding = new MarginPadding(5);
}
protected override Dropdown<IResultType> CreateDropdown() => null;
protected override Dropdown<IResultPageInfo> CreateDropdown() => null;
protected override TabItem<IResultType> CreateTabItem(IResultType value) => new ResultModeButton(value)
protected override TabItem<IResultPageInfo> CreateTabItem(IResultPageInfo value) => new ResultModeButton(value)
{
Anchor = TabContainer.Anchor,
Origin = TabContainer.Origin

View File

@ -19,7 +19,6 @@ using osu.Game.Graphics.UserInterface;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics.Sprites;
using osu.Game.Scoring;
using osu.Game.Screens.Ranking.Types;
namespace osu.Game.Screens.Ranking
{
@ -281,6 +280,6 @@ namespace osu.Game.Screens.Ranking
}, true);
}
protected abstract IEnumerable<IResultType> CreateResultTypes();
protected abstract IEnumerable<IResultPageInfo> CreateResultTypes();
}
}

View File

@ -12,9 +12,9 @@ using osu.Game.Scoring;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Screens.Ranking.Pages
namespace osu.Game.Screens.Ranking
{
public class ResultsPage : Container
public abstract class ResultsPage : Container
{
protected readonly ScoreInfo Score;
protected readonly WorkingBeatmap Beatmap;
@ -23,7 +23,7 @@ namespace osu.Game.Screens.Ranking.Pages
protected override Container<Drawable> Content => content;
public ResultsPage(ScoreInfo score, WorkingBeatmap beatmap)
protected ResultsPage(ScoreInfo score, WorkingBeatmap beatmap)
{
Score = score;
Beatmap = beatmap;

View File

@ -8,12 +8,12 @@ using osu.Game.Screens.Ranking.Pages;
namespace osu.Game.Screens.Ranking.Types
{
public class RankingResultType : IResultType
public class BeatmapLeaderboardPageInfo : IResultPageInfo
{
private readonly ScoreInfo score;
private readonly WorkingBeatmap beatmap;
public RankingResultType(ScoreInfo score, WorkingBeatmap beatmap)
public BeatmapLeaderboardPageInfo(ScoreInfo score, WorkingBeatmap beatmap)
{
this.score = score;
this.beatmap = beatmap;
@ -21,6 +21,8 @@ namespace osu.Game.Screens.Ranking.Types
public FontAwesome Icon => FontAwesome.fa_list;
public string Name => @"Beatmap Leaderboard";
public ResultsPage CreatePage() => new RankingResultsPage(score, beatmap);
}
}

View File

@ -8,18 +8,20 @@ using osu.Game.Screens.Ranking.Pages;
namespace osu.Game.Screens.Ranking.Types
{
public class ScoreResultType : IResultType
public class ScoreOverviewPageInfo : IResultPageInfo
{
private readonly ScoreInfo score;
private readonly WorkingBeatmap beatmap;
public ScoreResultType(ScoreInfo score, WorkingBeatmap beatmap)
public ScoreOverviewPageInfo(ScoreInfo score, WorkingBeatmap beatmap)
{
this.score = score;
this.beatmap = beatmap;
}
public FontAwesome Icon => FontAwesome.fa_asterisk;
public string Name => "Overview";
public ResultsPage CreatePage() => new ScoreResultsPage(score, beatmap);
}