public void GenerateCountryOnMap(ICountry country, IList <IProvince> regions, IHexMap map, int regionCount, float step) { for (var j = 0; j < 20; j++) { _trace.Add($"Try genereate provinces for country {country.Name} attempt {j}"); if (!TryGenerateCountry(country, regions, map, regionCount, step)) { continue; } country.SetCapital(map); country.DrawBorder(map); return; } throw new InvalidOperationException($"Country {country.Name} could not be generated due to lack of space on the map."); }