UserCountry -> Country

This commit is contained in:
Salman Ahmed
2022-07-18 08:40:43 +03:00
parent 100c53f9ef
commit ef6e16b1cb

View File

@ -34,20 +34,20 @@ namespace osu.Game.Online.API.Requests.Responses
[JsonProperty(@"previous_usernames")] [JsonProperty(@"previous_usernames")]
public string[] PreviousUsernames; public string[] PreviousUsernames;
private Country? country; private CountryCode? countryCode;
public Country Country public CountryCode CountryCode
{ {
get => country ??= (Enum.TryParse(userCountry?.Code, out Country result) ? result : default); get => countryCode ??= (Enum.TryParse(country?.Code, out CountryCode result) ? result : default);
set => country = value; set => countryCode = value;
} }
#pragma warning disable 649 #pragma warning disable 649
[CanBeNull] [CanBeNull]
[JsonProperty(@"country")] [JsonProperty(@"country")]
private UserCountry userCountry; private Country country;
private class UserCountry private class Country
{ {
[JsonProperty(@"code")] [JsonProperty(@"code")]
public string Code; public string Code;