mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:27:29 +08:00
Privatize UserRanks
and expose a similar CountryRank
field instead
This commit is contained in:
parent
e14a59f272
commit
a407bfe73b
@ -34,7 +34,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
Statistics = new UserStatistics
|
||||
{
|
||||
GlobalRank = 2148,
|
||||
Ranks = new UserStatistics.UserRanks { Country = 1, },
|
||||
CountryRank = 1,
|
||||
PP = 4567.89m,
|
||||
Level = new UserStatistics.LevelInfo
|
||||
{
|
||||
|
@ -145,7 +145,7 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
private void updateDisplay(User user)
|
||||
{
|
||||
hiddenDetailGlobal.Content = user?.Statistics?.GlobalRank?.ToString("\\##,##0") ?? "-";
|
||||
hiddenDetailCountry.Content = user?.Statistics?.Ranks.Country?.ToString("\\##,##0") ?? "-";
|
||||
hiddenDetailCountry.Content = user?.Statistics?.CountryRank?.ToString("\\##,##0") ?? "-";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
scoreRankInfo.Value.RankCount = user?.Statistics?.GradesCount[scoreRankInfo.Key] ?? 0;
|
||||
|
||||
detailGlobalRank.Content = user?.Statistics?.GlobalRank?.ToString("\\##,##0") ?? "-";
|
||||
detailCountryRank.Content = user?.Statistics?.Ranks.Country?.ToString("\\##,##0") ?? "-";
|
||||
detailCountryRank.Content = user?.Statistics?.CountryRank?.ToString("\\##,##0") ?? "-";
|
||||
|
||||
rankGraph.Statistics.Value = user?.Statistics;
|
||||
}
|
||||
|
@ -29,10 +29,15 @@ namespace osu.Game.Users
|
||||
[JsonProperty(@"global_rank")]
|
||||
public int? GlobalRank;
|
||||
|
||||
// eventually UserRanks object will be completely replaced with separate global rank (exists) and country rank properties
|
||||
// see https://github.com/ppy/osu-web/blob/cb79bb72186c8f1a25f6a6f5ef315123decb4231/app/Transformers/UserStatisticsTransformer.php#L53.
|
||||
public int? CountryRank;
|
||||
|
||||
[JsonProperty(@"rank")]
|
||||
public UserRanks Ranks;
|
||||
private UserRanks ranks
|
||||
{
|
||||
// eventually that will also become an own json property instead of reading from a `rank` object.
|
||||
// see https://github.com/ppy/osu-web/blob/cb79bb72186c8f1a25f6a6f5ef315123decb4231/app/Transformers/UserStatisticsTransformer.php#L53.
|
||||
set => CountryRank = value.Country;
|
||||
}
|
||||
|
||||
[JsonProperty(@"pp")]
|
||||
public decimal? PP;
|
||||
@ -115,7 +120,7 @@ namespace osu.Game.Users
|
||||
}
|
||||
}
|
||||
|
||||
public struct UserRanks
|
||||
private struct UserRanks
|
||||
{
|
||||
[JsonProperty(@"country")]
|
||||
public int? Country;
|
||||
|
Loading…
Reference in New Issue
Block a user