45 lines
1.2 KiB
C#
45 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using TransportGame.Generator;
|
|
using TransportGame.Model;
|
|
using TransportGame.Utils;
|
|
|
|
namespace TransportGame.Generator
|
|
{
|
|
/// <summary>
|
|
/// Complete city generator. Generates everything, from terrain to buildings
|
|
/// </summary>
|
|
public class CityGenerator
|
|
{
|
|
/// <summary>
|
|
/// Generates a city
|
|
/// </summary>
|
|
/// <param name="width">Width</param>
|
|
/// <param name="height">Height</param>
|
|
/// <returns>City</returns>
|
|
public Map Generate(int width, int height)
|
|
{
|
|
Map map;
|
|
|
|
// Generate terrain
|
|
TerrainGenerator terrainGen = new TerrainGenerator();
|
|
map = terrainGen.Generate(width, height);
|
|
|
|
// Generate population map
|
|
PopulationCentersGenerator populationGen = new PopulationCentersGenerator();
|
|
populationGen.Generate(map);
|
|
|
|
// Generate roads
|
|
RoadGenerator roadGenerator = new RoadGenerator();
|
|
roadGenerator.Generate(map);
|
|
|
|
Logger.DumpMap(map, "withroads.map");
|
|
|
|
// Done
|
|
return map;
|
|
}
|
|
}
|
|
}
|