1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-21 02:23:06 +08:00

-IHasDrawableRepresentation, User.Region -> Country

This commit is contained in:
DrabWeb 2017-03-19 00:09:58 -03:00
parent 0bc8ed9c9e
commit b0e7296e25
7 changed files with 18 additions and 41 deletions

View File

@ -33,7 +33,7 @@ namespace osu.Desktop.VisualTests.Tests
{
Id = 6602580,
Username = @"waaiiru",
Region = new Country
Country = new Country
{
FullName = @"Spain",
FlagName = @"ES",
@ -51,7 +51,7 @@ namespace osu.Desktop.VisualTests.Tests
{
Id = 4608074,
Username = @"Skycries",
Region = new Country
Country = new Country
{
FullName = @"Brazil",
FlagName = @"BR",
@ -69,7 +69,7 @@ namespace osu.Desktop.VisualTests.Tests
{
Id = 1014222,
Username = @"eLy",
Region = new Country
Country = new Country
{
FullName = @"Japan",
FlagName = @"JP",
@ -87,7 +87,7 @@ namespace osu.Desktop.VisualTests.Tests
{
Id = 1541390,
Username = @"Toukai",
Region = new Country
Country = new Country
{
FullName = @"Canada",
FlagName = @"CA",
@ -105,7 +105,7 @@ namespace osu.Desktop.VisualTests.Tests
{
Id = 2243452,
Username = @"Satoruu",
Region = new Country
Country = new Country
{
FullName = @"Venezuela",
FlagName = @"VE",
@ -123,7 +123,7 @@ namespace osu.Desktop.VisualTests.Tests
{
Id = 2705430,
Username = @"Mooha",
Region = new Country
Country = new Country
{
FullName = @"France",
FlagName = @"FR",
@ -141,7 +141,7 @@ namespace osu.Desktop.VisualTests.Tests
{
Id = 7151382,
Username = @"Mayuri Hana",
Region = new Country
Country = new Country
{
FullName = @"Thailand",
FlagName = @"TH",
@ -159,7 +159,7 @@ namespace osu.Desktop.VisualTests.Tests
{
Id = 2051389,
Username = @"FunOrange",
Region = new Country
Country = new Country
{
FullName = @"Canada",
FlagName = @"CA",
@ -177,7 +177,7 @@ namespace osu.Desktop.VisualTests.Tests
{
Id = 6169483,
Username = @"-Hebel-",
Region = new Country
Country = new Country
{
FullName = @"Mexico",
FlagName = @"MX",
@ -195,7 +195,7 @@ namespace osu.Desktop.VisualTests.Tests
{
Id = 6702666,
Username = @"prhtnsm",
Region = new Country
Country = new Country
{
FullName = @"Germany",
FlagName = @"DE",

View File

@ -1,12 +0,0 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
namespace osu.Game.Graphics.UserInterface
{
public interface IHasDrawableRepresentation<out T> where T : Drawable
{
T CreateDrawable();
}
}

View File

@ -104,10 +104,6 @@ namespace osu.Game.Screens.Select.Leaderboards
RelativeSizeAxes = Axes.X;
Height = HEIGHT;
var flag = Score.User?.Region.CreateDrawable() ?? new DrawableFlag();
flag.Width = 30;
flag.RelativeSizeAxes = Axes.Y;
Children = new Drawable[]
{
new Container
@ -189,7 +185,11 @@ namespace osu.Game.Screens.Select.Leaderboards
Masking = true,
Children = new Drawable[]
{
flag,
new DrawableFlag(Score.User?.Country?.FlagName ?? "__")
{
Width = 30,
RelativeSizeAxes = Axes.Y,
},
},
},
new FillFlowContainer

View File

@ -10,7 +10,7 @@ using osu.Game.Graphics.UserInterface;
namespace osu.Game.Users
{
public class Country : IHasDrawableRepresentation<DrawableFlag>
public class Country
{
/// <summary>
/// The name of this country.
@ -26,11 +26,6 @@ namespace osu.Game.Users
/// Two-letter flag acronym (ISO 3166 standard)
/// </summary>
public string FlagName;
public DrawableFlag CreateDrawable()
{
return new DrawableFlag(FlagName);
}
}
public class DrawableFlag : Container

View File

@ -6,13 +6,8 @@ using osu.Game.Graphics.UserInterface;
namespace osu.Game.Users
{
public class Team : IHasDrawableRepresentation<Sprite>
public class Team
{
public string Name;
public Sprite CreateDrawable()
{
return new Sprite();
}
}
}

View File

@ -7,7 +7,7 @@ namespace osu.Game.Users
{
public int Id;
public string Username;
public Country Region;
public Country Country;
public Team Team;
}
}

View File

@ -354,7 +354,6 @@
<Compile Include="Screens\Select\Options\BeatmapOptionsOverlay.cs" />
<Compile Include="Screens\Select\Leaderboards\Leaderboard.cs" />
<Compile Include="Screens\Select\Leaderboards\LeaderboardScore.cs" />
<Compile Include="Graphics\UserInterface\IHasDrawableRepresentation.cs" />
<Compile Include="Users\Country.cs" />
<Compile Include="Users\Team.cs" />
<Compile Include="Modes\ScoreRank.cs" />