diff --git a/osu.Game.Tournament/Components/TournamentTeam.cs b/osu.Game.Tournament/Components/TournamentTeam.cs index 78e1386706..62dc703fee 100644 --- a/osu.Game.Tournament/Components/TournamentTeam.cs +++ b/osu.Game.Tournament/Components/TournamentTeam.cs @@ -39,7 +39,7 @@ namespace osu.Game.Tournament.Components } [JsonProperty] - public List Players { get; set; } + public List Players { get; set; } = new List(); public override string ToString() => FullName ?? Acronym; } diff --git a/osu.Game.Tournament/Resources/countries.json b/osu.Game.Tournament/Resources/countries.json new file mode 100644 index 0000000000..ec2ca2bf37 --- /dev/null +++ b/osu.Game.Tournament/Resources/countries.json @@ -0,0 +1,1252 @@ +[ + { + "FlagName": "BD", + "FullName": "Bangladesh", + "Acronym": "BGD" + }, + { + "FlagName": "BE", + "FullName": "Belgium", + "Acronym": "BEL" + }, + { + "FlagName": "BF", + "FullName": "Burkina Faso", + "Acronym": "BFA" + }, + { + "FlagName": "BG", + "FullName": "Bulgaria", + "Acronym": "BGR" + }, + { + "FlagName": "BA", + "FullName": "Bosnia and Herzegovina", + "Acronym": "BIH" + }, + { + "FlagName": "BB", + "FullName": "Barbados", + "Acronym": "BRB" + }, + { + "FlagName": "WF", + "FullName": "Wallis and Futuna", + "Acronym": "WLF" + }, + { + "FlagName": "BL", + "FullName": "Saint Barthelemy", + "Acronym": "BLM" + }, + { + "FlagName": "BM", + "FullName": "Bermuda", + "Acronym": "BMU" + }, + { + "FlagName": "BN", + "FullName": "Brunei", + "Acronym": "BRN" + }, + { + "FlagName": "BO", + "FullName": "Bolivia", + "Acronym": "BOL" + }, + { + "FlagName": "BH", + "FullName": "Bahrain", + "Acronym": "BHR" + }, + { + "FlagName": "BI", + "FullName": "Burundi", + "Acronym": "BDI" + }, + { + "FlagName": "BJ", + "FullName": "Benin", + "Acronym": "BEN" + }, + { + "FlagName": "BT", + "FullName": "Bhutan", + "Acronym": "BTN" + }, + { + "FlagName": "JM", + "FullName": "Jamaica", + "Acronym": "JAM" + }, + { + "FlagName": "BV", + "FullName": "Bouvet Island", + "Acronym": "BVT" + }, + { + "FlagName": "BW", + "FullName": "Botswana", + "Acronym": "BWA" + }, + { + "FlagName": "WS", + "FullName": "Samoa", + "Acronym": "WSM" + }, + { + "FlagName": "BQ", + "FullName": "Bonaire, Saint Eustatius and Saba", + "Acronym": "BES" + }, + { + "FlagName": "BR", + "FullName": "Brazil", + "Acronym": "BRA" + }, + { + "FlagName": "BS", + "FullName": "Bahamas", + "Acronym": "BHS" + }, + { + "FlagName": "JE", + "FullName": "Jersey", + "Acronym": "JEY" + }, + { + "FlagName": "BY", + "FullName": "Belarus", + "Acronym": "BLR" + }, + { + "FlagName": "BZ", + "FullName": "Belize", + "Acronym": "BLZ" + }, + { + "FlagName": "RU", + "FullName": "Russia", + "Acronym": "RUS" + }, + { + "FlagName": "RW", + "FullName": "Rwanda", + "Acronym": "RWA" + }, + { + "FlagName": "RS", + "FullName": "Serbia", + "Acronym": "SRB" + }, + { + "FlagName": "TL", + "FullName": "East Timor", + "Acronym": "TLS" + }, + { + "FlagName": "RE", + "FullName": "Reunion", + "Acronym": "REU" + }, + { + "FlagName": "TM", + "FullName": "Turkmenistan", + "Acronym": "TKM" + }, + { + "FlagName": "TJ", + "FullName": "Tajikistan", + "Acronym": "TJK" + }, + { + "FlagName": "RO", + "FullName": "Romania", + "Acronym": "ROU" + }, + { + "FlagName": "TK", + "FullName": "Tokelau", + "Acronym": "TKL" + }, + { + "FlagName": "GW", + "FullName": "Guinea-Bissau", + "Acronym": "GNB" + }, + { + "FlagName": "GU", + "FullName": "Guam", + "Acronym": "GUM" + }, + { + "FlagName": "GT", + "FullName": "Guatemala", + "Acronym": "GTM" + }, + { + "FlagName": "GS", + "FullName": "South Georgia and the South Sandwich Islands", + "Acronym": "SGS" + }, + { + "FlagName": "GR", + "FullName": "Greece", + "Acronym": "GRC" + }, + { + "FlagName": "GQ", + "FullName": "Equatorial Guinea", + "Acronym": "GNQ" + }, + { + "FlagName": "GP", + "FullName": "Guadeloupe", + "Acronym": "GLP" + }, + { + "FlagName": "JP", + "FullName": "Japan", + "Acronym": "JPN" + }, + { + "FlagName": "GY", + "FullName": "Guyana", + "Acronym": "GUY" + }, + { + "FlagName": "GG", + "FullName": "Guernsey", + "Acronym": "GGY" + }, + { + "FlagName": "GF", + "FullName": "French Guiana", + "Acronym": "GUF" + }, + { + "FlagName": "GE", + "FullName": "Georgia", + "Acronym": "GEO" + }, + { + "FlagName": "GD", + "FullName": "Grenada", + "Acronym": "GRD" + }, + { + "FlagName": "GB", + "FullName": "United Kingdom", + "Acronym": "GBR" + }, + { + "FlagName": "GA", + "FullName": "Gabon", + "Acronym": "GAB" + }, + { + "FlagName": "SV", + "FullName": "El Salvador", + "Acronym": "SLV" + }, + { + "FlagName": "GN", + "FullName": "Guinea", + "Acronym": "GIN" + }, + { + "FlagName": "GM", + "FullName": "Gambia", + "Acronym": "GMB" + }, + { + "FlagName": "GL", + "FullName": "Greenland", + "Acronym": "GRL" + }, + { + "FlagName": "GI", + "FullName": "Gibraltar", + "Acronym": "GIB" + }, + { + "FlagName": "GH", + "FullName": "Ghana", + "Acronym": "GHA" + }, + { + "FlagName": "OM", + "FullName": "Oman", + "Acronym": "OMN" + }, + { + "FlagName": "TN", + "FullName": "Tunisia", + "Acronym": "TUN" + }, + { + "FlagName": "JO", + "FullName": "Jordan", + "Acronym": "JOR" + }, + { + "FlagName": "HR", + "FullName": "Croatia", + "Acronym": "HRV" + }, + { + "FlagName": "HT", + "FullName": "Haiti", + "Acronym": "HTI" + }, + { + "FlagName": "HU", + "FullName": "Hungary", + "Acronym": "HUN" + }, + { + "FlagName": "HK", + "FullName": "Hong Kong", + "Acronym": "HKG" + }, + { + "FlagName": "HN", + "FullName": "Honduras", + "Acronym": "HND" + }, + { + "FlagName": "HM", + "FullName": "Heard Island and McDonald Islands", + "Acronym": "HMD" + }, + { + "FlagName": "VE", + "FullName": "Venezuela", + "Acronym": "VEN" + }, + { + "FlagName": "PR", + "FullName": "Puerto Rico", + "Acronym": "PRI" + }, + { + "FlagName": "PS", + "FullName": "Palestinian Territory", + "Acronym": "PSE" + }, + { + "FlagName": "PW", + "FullName": "Palau", + "Acronym": "PLW" + }, + { + "FlagName": "PT", + "FullName": "Portugal", + "Acronym": "PRT" + }, + { + "FlagName": "SJ", + "FullName": "Svalbard and Jan Mayen", + "Acronym": "SJM" + }, + { + "FlagName": "PY", + "FullName": "Paraguay", + "Acronym": "PRY" + }, + { + "FlagName": "IQ", + "FullName": "Iraq", + "Acronym": "IRQ" + }, + { + "FlagName": "PA", + "FullName": "Panama", + "Acronym": "PAN" + }, + { + "FlagName": "PF", + "FullName": "French Polynesia", + "Acronym": "PYF" + }, + { + "FlagName": "PG", + "FullName": "Papua New Guinea", + "Acronym": "PNG" + }, + { + "FlagName": "PE", + "FullName": "Peru", + "Acronym": "PER" + }, + { + "FlagName": "PK", + "FullName": "Pakistan", + "Acronym": "PAK" + }, + { + "FlagName": "PH", + "FullName": "Philippines", + "Acronym": "PHL" + }, + { + "FlagName": "PN", + "FullName": "Pitcairn", + "Acronym": "PCN" + }, + { + "FlagName": "PL", + "FullName": "Poland", + "Acronym": "POL" + }, + { + "FlagName": "PM", + "FullName": "Saint Pierre and Miquelon", + "Acronym": "SPM" + }, + { + "FlagName": "ZM", + "FullName": "Zambia", + "Acronym": "ZMB" + }, + { + "FlagName": "EH", + "FullName": "Western Sahara", + "Acronym": "ESH" + }, + { + "FlagName": "EE", + "FullName": "Estonia", + "Acronym": "EST" + }, + { + "FlagName": "EG", + "FullName": "Egypt", + "Acronym": "EGY" + }, + { + "FlagName": "ZA", + "FullName": "South Africa", + "Acronym": "ZAF" + }, + { + "FlagName": "EC", + "FullName": "Ecuador", + "Acronym": "ECU" + }, + { + "FlagName": "IT", + "FullName": "Italy", + "Acronym": "ITA" + }, + { + "FlagName": "VN", + "FullName": "Vietnam", + "Acronym": "VNM" + }, + { + "FlagName": "SB", + "FullName": "Solomon Islands", + "Acronym": "SLB" + }, + { + "FlagName": "ET", + "FullName": "Ethiopia", + "Acronym": "ETH" + }, + { + "FlagName": "SO", + "FullName": "Somalia", + "Acronym": "SOM" + }, + { + "FlagName": "ZW", + "FullName": "Zimbabwe", + "Acronym": "ZWE" + }, + { + "FlagName": "SA", + "FullName": "Saudi Arabia", + "Acronym": "SAU" + }, + { + "FlagName": "ES", + "FullName": "Spain", + "Acronym": "ESP" + }, + { + "FlagName": "ER", + "FullName": "Eritrea", + "Acronym": "ERI" + }, + { + "FlagName": "ME", + "FullName": "Montenegro", + "Acronym": "MNE" + }, + { + "FlagName": "MD", + "FullName": "Moldova", + "Acronym": "MDA" + }, + { + "FlagName": "MG", + "FullName": "Madagascar", + "Acronym": "MDG" + }, + { + "FlagName": "MF", + "FullName": "Saint Martin", + "Acronym": "MAF" + }, + { + "FlagName": "MA", + "FullName": "Morocco", + "Acronym": "MAR" + }, + { + "FlagName": "MC", + "FullName": "Monaco", + "Acronym": "MCO" + }, + { + "FlagName": "UZ", + "FullName": "Uzbekistan", + "Acronym": "UZB" + }, + { + "FlagName": "MM", + "FullName": "Myanmar", + "Acronym": "MMR" + }, + { + "FlagName": "ML", + "FullName": "Mali", + "Acronym": "MLI" + }, + { + "FlagName": "MO", + "FullName": "Macao", + "Acronym": "MAC" + }, + { + "FlagName": "MN", + "FullName": "Mongolia", + "Acronym": "MNG" + }, + { + "FlagName": "MH", + "FullName": "Marshall Islands", + "Acronym": "MHL" + }, + { + "FlagName": "MK", + "FullName": "Macedonia", + "Acronym": "MKD" + }, + { + "FlagName": "MU", + "FullName": "Mauritius", + "Acronym": "MUS" + }, + { + "FlagName": "MT", + "FullName": "Malta", + "Acronym": "MLT" + }, + { + "FlagName": "MW", + "FullName": "Malawi", + "Acronym": "MWI" + }, + { + "FlagName": "MV", + "FullName": "Maldives", + "Acronym": "MDV" + }, + { + "FlagName": "MQ", + "FullName": "Martinique", + "Acronym": "MTQ" + }, + { + "FlagName": "MP", + "FullName": "Northern Mariana Islands", + "Acronym": "MNP" + }, + { + "FlagName": "MS", + "FullName": "Montserrat", + "Acronym": "MSR" + }, + { + "FlagName": "MR", + "FullName": "Mauritania", + "Acronym": "MRT" + }, + { + "FlagName": "IM", + "FullName": "Isle of Man", + "Acronym": "IMN" + }, + { + "FlagName": "UG", + "FullName": "Uganda", + "Acronym": "UGA" + }, + { + "FlagName": "TZ", + "FullName": "Tanzania", + "Acronym": "TZA" + }, + { + "FlagName": "MY", + "FullName": "Malaysia", + "Acronym": "MYS" + }, + { + "FlagName": "MX", + "FullName": "Mexico", + "Acronym": "MEX" + }, + { + "FlagName": "IL", + "FullName": "Israel", + "Acronym": "ISR" + }, + { + "FlagName": "FR", + "FullName": "France", + "Acronym": "FRA" + }, + { + "FlagName": "IO", + "FullName": "British Indian Ocean Territory", + "Acronym": "IOT" + }, + { + "FlagName": "SH", + "FullName": "Saint Helena", + "Acronym": "SHN" + }, + { + "FlagName": "FI", + "FullName": "Finland", + "Acronym": "FIN" + }, + { + "FlagName": "FJ", + "FullName": "Fiji", + "Acronym": "FJI" + }, + { + "FlagName": "FK", + "FullName": "Falkland Islands", + "Acronym": "FLK" + }, + { + "FlagName": "FM", + "FullName": "Micronesia", + "Acronym": "FSM" + }, + { + "FlagName": "FO", + "FullName": "Faroe Islands", + "Acronym": "FRO" + }, + { + "FlagName": "NI", + "FullName": "Nicaragua", + "Acronym": "NIC" + }, + { + "FlagName": "NL", + "FullName": "Netherlands", + "Acronym": "NLD" + }, + { + "FlagName": "NO", + "FullName": "Norway", + "Acronym": "NOR" + }, + { + "FlagName": "NA", + "FullName": "Namibia", + "Acronym": "NAM" + }, + { + "FlagName": "VU", + "FullName": "Vanuatu", + "Acronym": "VUT" + }, + { + "FlagName": "NC", + "FullName": "New Caledonia", + "Acronym": "NCL" + }, + { + "FlagName": "NE", + "FullName": "Niger", + "Acronym": "NER" + }, + { + "FlagName": "NF", + "FullName": "Norfolk Island", + "Acronym": "NFK" + }, + { + "FlagName": "NG", + "FullName": "Nigeria", + "Acronym": "NGA" + }, + { + "FlagName": "NZ", + "FullName": "New Zealand", + "Acronym": "NZL" + }, + { + "FlagName": "NP", + "FullName": "Nepal", + "Acronym": "NPL" + }, + { + "FlagName": "NR", + "FullName": "Nauru", + "Acronym": "NRU" + }, + { + "FlagName": "NU", + "FullName": "Niue", + "Acronym": "NIU" + }, + { + "FlagName": "CK", + "FullName": "Cook Islands", + "Acronym": "COK" + }, + { + "FlagName": "XK", + "FullName": "Kosovo", + "Acronym": "XKX" + }, + { + "FlagName": "CI", + "FullName": "Ivory Coast", + "Acronym": "CIV" + }, + { + "FlagName": "CH", + "FullName": "Switzerland", + "Acronym": "CHE" + }, + { + "FlagName": "CO", + "FullName": "Colombia", + "Acronym": "COL" + }, + { + "FlagName": "CN", + "FullName": "China", + "Acronym": "CHN" + }, + { + "FlagName": "CM", + "FullName": "Cameroon", + "Acronym": "CMR" + }, + { + "FlagName": "CL", + "FullName": "Chile", + "Acronym": "CHL" + }, + { + "FlagName": "CC", + "FullName": "Cocos Islands", + "Acronym": "CCK" + }, + { + "FlagName": "CA", + "FullName": "Canada", + "Acronym": "CAN" + }, + { + "FlagName": "CG", + "FullName": "Republic of the Congo", + "Acronym": "COG" + }, + { + "FlagName": "CF", + "FullName": "Central African Republic", + "Acronym": "CAF" + }, + { + "FlagName": "CD", + "FullName": "Democratic Republic of the Congo", + "Acronym": "COD" + }, + { + "FlagName": "CZ", + "FullName": "Czech Republic", + "Acronym": "CZE" + }, + { + "FlagName": "CY", + "FullName": "Cyprus", + "Acronym": "CYP" + }, + { + "FlagName": "CX", + "FullName": "Christmas Island", + "Acronym": "CXR" + }, + { + "FlagName": "CR", + "FullName": "Costa Rica", + "Acronym": "CRI" + }, + { + "FlagName": "CW", + "FullName": "Curacao", + "Acronym": "CUW" + }, + { + "FlagName": "CV", + "FullName": "Cape Verde", + "Acronym": "CPV" + }, + { + "FlagName": "CU", + "FullName": "Cuba", + "Acronym": "CUB" + }, + { + "FlagName": "SZ", + "FullName": "Swaziland", + "Acronym": "SWZ" + }, + { + "FlagName": "SY", + "FullName": "Syria", + "Acronym": "SYR" + }, + { + "FlagName": "SX", + "FullName": "Sint Maarten", + "Acronym": "SXM" + }, + { + "FlagName": "KG", + "FullName": "Kyrgyzstan", + "Acronym": "KGZ" + }, + { + "FlagName": "KE", + "FullName": "Kenya", + "Acronym": "KEN" + }, + { + "FlagName": "SS", + "FullName": "South Sudan", + "Acronym": "SSD" + }, + { + "FlagName": "SR", + "FullName": "Suriname", + "Acronym": "SUR" + }, + { + "FlagName": "KI", + "FullName": "Kiribati", + "Acronym": "KIR" + }, + { + "FlagName": "KH", + "FullName": "Cambodia", + "Acronym": "KHM" + }, + { + "FlagName": "KN", + "FullName": "Saint Kitts and Nevis", + "Acronym": "KNA" + }, + { + "FlagName": "KM", + "FullName": "Comoros", + "Acronym": "COM" + }, + { + "FlagName": "ST", + "FullName": "Sao Tome and Principe", + "Acronym": "STP" + }, + { + "FlagName": "SK", + "FullName": "Slovakia", + "Acronym": "SVK" + }, + { + "FlagName": "KR", + "FullName": "South Korea", + "Acronym": "KOR" + }, + { + "FlagName": "SI", + "FullName": "Slovenia", + "Acronym": "SVN" + }, + { + "FlagName": "KP", + "FullName": "North Korea", + "Acronym": "PRK" + }, + { + "FlagName": "KW", + "FullName": "Kuwait", + "Acronym": "KWT" + }, + { + "FlagName": "SN", + "FullName": "Senegal", + "Acronym": "SEN" + }, + { + "FlagName": "SM", + "FullName": "San Marino", + "Acronym": "SMR" + }, + { + "FlagName": "SL", + "FullName": "Sierra Leone", + "Acronym": "SLE" + }, + { + "FlagName": "SC", + "FullName": "Seychelles", + "Acronym": "SYC" + }, + { + "FlagName": "KZ", + "FullName": "Kazakhstan", + "Acronym": "KAZ" + }, + { + "FlagName": "KY", + "FullName": "Cayman Islands", + "Acronym": "CYM" + }, + { + "FlagName": "SG", + "FullName": "Singapore", + "Acronym": "SGP" + }, + { + "FlagName": "SE", + "FullName": "Sweden", + "Acronym": "SWE" + }, + { + "FlagName": "SD", + "FullName": "Sudan", + "Acronym": "SDN" + }, + { + "FlagName": "DO", + "FullName": "Dominican Republic", + "Acronym": "DOM" + }, + { + "FlagName": "DM", + "FullName": "Dominica", + "Acronym": "DMA" + }, + { + "FlagName": "DJ", + "FullName": "Djibouti", + "Acronym": "DJI" + }, + { + "FlagName": "DK", + "FullName": "Denmark", + "Acronym": "DNK" + }, + { + "FlagName": "VG", + "FullName": "British Virgin Islands", + "Acronym": "VGB" + }, + { + "FlagName": "DE", + "FullName": "Germany", + "Acronym": "DEU" + }, + { + "FlagName": "YE", + "FullName": "Yemen", + "Acronym": "YEM" + }, + { + "FlagName": "DZ", + "FullName": "Algeria", + "Acronym": "DZA" + }, + { + "FlagName": "US", + "FullName": "United States", + "Acronym": "USA" + }, + { + "FlagName": "UY", + "FullName": "Uruguay", + "Acronym": "URY" + }, + { + "FlagName": "YT", + "FullName": "Mayotte", + "Acronym": "MYT" + }, + { + "FlagName": "UM", + "FullName": "United States Minor Outlying Islands", + "Acronym": "UMI" + }, + { + "FlagName": "LB", + "FullName": "Lebanon", + "Acronym": "LBN" + }, + { + "FlagName": "LC", + "FullName": "Saint Lucia", + "Acronym": "LCA" + }, + { + "FlagName": "LA", + "FullName": "Laos", + "Acronym": "LAO" + }, + { + "FlagName": "TV", + "FullName": "Tuvalu", + "Acronym": "TUV" + }, + { + "FlagName": "TW", + "FullName": "Taiwan", + "Acronym": "TWN" + }, + { + "FlagName": "TT", + "FullName": "Trinidad and Tobago", + "Acronym": "TTO" + }, + { + "FlagName": "TR", + "FullName": "Turkey", + "Acronym": "TUR" + }, + { + "FlagName": "LK", + "FullName": "Sri Lanka", + "Acronym": "LKA" + }, + { + "FlagName": "LI", + "FullName": "Liechtenstein", + "Acronym": "LIE" + }, + { + "FlagName": "LV", + "FullName": "Latvia", + "Acronym": "LVA" + }, + { + "FlagName": "TO", + "FullName": "Tonga", + "Acronym": "TON" + }, + { + "FlagName": "LT", + "FullName": "Lithuania", + "Acronym": "LTU" + }, + { + "FlagName": "LU", + "FullName": "Luxembourg", + "Acronym": "LUX" + }, + { + "FlagName": "LR", + "FullName": "Liberia", + "Acronym": "LBR" + }, + { + "FlagName": "LS", + "FullName": "Lesotho", + "Acronym": "LSO" + }, + { + "FlagName": "TH", + "FullName": "Thailand", + "Acronym": "THA" + }, + { + "FlagName": "TF", + "FullName": "French Southern Territories", + "Acronym": "ATF" + }, + { + "FlagName": "TG", + "FullName": "Togo", + "Acronym": "TGO" + }, + { + "FlagName": "TD", + "FullName": "Chad", + "Acronym": "TCD" + }, + { + "FlagName": "TC", + "FullName": "Turks and Caicos Islands", + "Acronym": "TCA" + }, + { + "FlagName": "LY", + "FullName": "Libya", + "Acronym": "LBY" + }, + { + "FlagName": "VA", + "FullName": "Vatican", + "Acronym": "VAT" + }, + { + "FlagName": "VC", + "FullName": "Saint Vincent and the Grenadines", + "Acronym": "VCT" + }, + { + "FlagName": "AE", + "FullName": "United Arab Emirates", + "Acronym": "ARE" + }, + { + "FlagName": "AD", + "FullName": "Andorra", + "Acronym": "AND" + }, + { + "FlagName": "AG", + "FullName": "Antigua and Barbuda", + "Acronym": "ATG" + }, + { + "FlagName": "AF", + "FullName": "Afghanistan", + "Acronym": "AFG" + }, + { + "FlagName": "AI", + "FullName": "Anguilla", + "Acronym": "AIA" + }, + { + "FlagName": "VI", + "FullName": "U.S. Virgin Islands", + "Acronym": "VIR" + }, + { + "FlagName": "IS", + "FullName": "Iceland", + "Acronym": "ISL" + }, + { + "FlagName": "IR", + "FullName": "Iran", + "Acronym": "IRN" + }, + { + "FlagName": "AM", + "FullName": "Armenia", + "Acronym": "ARM" + }, + { + "FlagName": "AL", + "FullName": "Albania", + "Acronym": "ALB" + }, + { + "FlagName": "AO", + "FullName": "Angola", + "Acronym": "AGO" + }, + { + "FlagName": "AQ", + "FullName": "Antarctica", + "Acronym": "ATA" + }, + { + "FlagName": "AS", + "FullName": "American Samoa", + "Acronym": "ASM" + }, + { + "FlagName": "AR", + "FullName": "Argentina", + "Acronym": "ARG" + }, + { + "FlagName": "AU", + "FullName": "Australia", + "Acronym": "AUS" + }, + { + "FlagName": "AT", + "FullName": "Austria", + "Acronym": "AUT" + }, + { + "FlagName": "AW", + "FullName": "Aruba", + "Acronym": "ABW" + }, + { + "FlagName": "IN", + "FullName": "India", + "Acronym": "IND" + }, + { + "FlagName": "AX", + "FullName": "Aland Islands", + "Acronym": "ALA" + }, + { + "FlagName": "AZ", + "FullName": "Azerbaijan", + "Acronym": "AZE" + }, + { + "FlagName": "IE", + "FullName": "Ireland", + "Acronym": "IRL" + }, + { + "FlagName": "ID", + "FullName": "Indonesia", + "Acronym": "IDN" + }, + { + "FlagName": "UA", + "FullName": "Ukraine", + "Acronym": "UKR" + }, + { + "FlagName": "QA", + "FullName": "Qatar", + "Acronym": "QAT" + }, + { + "FlagName": "MZ", + "FullName": "Mozambique", + "Acronym": "MOZ" + } +] \ No newline at end of file diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index 2ae6c60067..f398dd0a3d 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Collections.Generic; using System.Drawing; using System.IO; using System.Linq; @@ -15,6 +16,7 @@ using osu.Game.Beatmaps; using osu.Game.Graphics.UserInterface; using osu.Game.Online.API.Requests; using osu.Game.Rulesets; +using osu.Game.Tournament.Components; namespace osu.Game.Tournament { @@ -87,12 +89,26 @@ namespace osu.Game.Tournament } } + // link pairings to groupings foreach (var group in Ladder.Groupings) foreach (var id in group.Pairings) Ladder.Pairings.Single(p => p.ID == id).Grouping.Value = group; Ladder.CurrentMatch.Value = Ladder.Pairings.FirstOrDefault(p => p.Current.Value); + // add full player info based on user IDs + foreach (var t in Ladder.Teams) + foreach (var p in t.Players) + if (p.Id == 1) + { + var req = new GetUserRequest(p.Id); + req.Success += i => p.Username = i.Username; + req.Perform(API); + + addedInfo = true; + } + + // add full beatmap info based on beatmap IDs foreach (var g in Ladder.Groupings) foreach (var b in g.Beatmaps) if (b.BeatmapInfo == null) @@ -104,6 +120,24 @@ namespace osu.Game.Tournament addedInfo = true; } + + List countries; + using (Stream stream = Resources.GetStream("Resources/countries.json")) + using (var sr = new StreamReader(stream)) + countries = JsonConvert.DeserializeObject>(sr.ReadToEnd()); + + foreach (var t in Ladder.Teams) + if (string.IsNullOrEmpty(t.FullName)) + { + var result = countries.FirstOrDefault(c => c.Acronym == t.Acronym); + if (result != null) + { + t.Acronym = result.Acronym; + t.FlagName = result.FlagName; + t.FullName = result.FullName; + } + } + if (addedInfo) SaveChanges(); @@ -126,7 +160,6 @@ namespace osu.Game.Tournament protected override void Update() { - base.Update(); var minWidth = (int)(windowSize.Value.Height / 9f * 16 + 400); if (windowSize.Value.Width < minWidth)