public void Generate(BaseLayer parentLayer) { CityLayer = parentLayer as CityLayer; if (CityLayer == null) { throw new Exception($"Cannot cast parent layer to type {typeof(CityLayer).Name} "); } PolygonIdToDistrictMap = new Dictionary <Polygon, DistrictData>(); SecondaryStreetGraph = new Graph <Vertex>(); // Only needed to expose data to the renderer Polygons = new List <Polygon>(); Regions = new List <Region>(); BuildDistrictPolygons(); SortRegionsByDistance(); GenerateDistricts(); SubdivideDistricts(); CreateSecondaryStreetGraph(); DevelopDistricts(); }
public void Init() { _instance = this; }