void setCountry(ValidCountries.Country validCountry) { string countryCode = ValidCountries.CountryToString(validCountry); ImageTexture texture = new ImageTexture(); texture.Load($"Resources/Graphics/Flags/{countryCode}.png"); country.Texture = texture; }
void generateFootballerField(FootballerData data) { PackedScene scene = (PackedScene)ResourceLoader.Load("Scenes/AdvancedComponents/FootballerShortInfoField.tscn"); FootballerShortInfoField field = (FootballerShortInfoField)scene.Instance(); string name = data.Name; string surname = data.Surname; int age = GameData.CURRENT_YEAR - data.BirthYear; int avg = data.Average; string country = ValidCountries.CountryToString(data.Country); field.Initialize(name, surname, age, avg, country); footballersList.AddChild(field); }