private void AddArea(Region region, Area area) { region.Areas.Add(area); area.Region = region; for (int i = 0; i < 7; i += 2) { SystemCoordinates coords = area.Coordinates.GetNeighbour(i); if (coords.isInAreaGridBounds()) { Area next_area = Program.State.getArea(coords); if (next_area.Type == AreaType.Continent && region.Type == RegionType.Continent || next_area.Type == AreaType.Ocean && region.Type == RegionType.Ocean) { if (next_area.Region == null) { AddArea(region, next_area); } } } } }