public static CityData GenerateCity(CitySettings settings, VoronoiDiagram voronoi) { if (voronoi.VoronoiCells.Count < 1) { return(null); } //Create helpers if none are created. if (_districtBuilder == null) { _districtBuilder = new DistrictBuilder(); } //Generate the city var cityData = new CityData(); voronoi.RefreshVoronoi(); //divide the city into districts cityData.Districts = _districtBuilder.CreateCityDistricts(settings, voronoi); cityData.Bounds = MathHelpers.GetCityBounds(cityData); return(cityData); }
public static CityData GenerateCity(CitySettings settings, VoronoiDiagram voronoi) { if (voronoi.VoronoiCells.Count < 1) return null; //Create helpers if none are created. if (_districtBuilder == null) { _districtBuilder = new DistrictBuilder(); } //Generate the city var cityData = new CityData(); voronoi.RefreshVoronoi(); //divide the city into districts cityData.Districts = _districtBuilder.CreateCityDistricts(settings,voronoi); cityData.Bounds = MathHelpers.GetCityBounds(cityData); return cityData; }