public virtual Map generate(MapConfiguration config, int size) { PerlinMapWrapper perlinMap = new PerlinMapWrapper(size, config.octaves, config.persistance, config.terrains, config.decorators); Case[,] cases = new Case[size, size]; List<Case> startingPositions = new List<Case>(); for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { int terrainIndex = perlinMap.GetTerrain(i, j); int decoratorIndex = perlinMap.GetDecorator(i, j); cases[i, j] = MapConfiguration.GetCase(terrainIndex, decoratorIndex, i, j); } } return new Map(cases); }
public virtual Map generate(MapConfiguration config, int size) { PerlinMapWrapper perlinMap = new PerlinMapWrapper(size, config.octaves, config.persistance, config.terrains, config.decorators); Case[,] cases = new Case[size, size]; List <Case> startingPositions = new List <Case>(); for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { int terrainIndex = perlinMap.GetTerrain(i, j); int decoratorIndex = perlinMap.GetDecorator(i, j); cases[i, j] = MapConfiguration.GetCase(terrainIndex, decoratorIndex, i, j); } } return(new Map(cases)); }
/// <summary> /// Creates a new game builder. /// You have to define the settings by calling AddPlayer, SetSize and SetTerrainFrequency and SetDecoratorProbability, as there are not default settings. /// </summary> public GameBuilder() { mapConfig = new MapConfiguration(); players = new Dictionary<string, ICivilization>(); }
/// <summary> /// Creates a new game builder. /// You have to define the settings by calling AddPlayer, SetSize and SetTerrainFrequency and SetDecoratorProbability, as there are not default settings. /// </summary> public GameBuilder() { mapConfig = new MapConfiguration(); players = new Dictionary <string, ICivilization>(); }
public abstract Map generate(MapConfiguration config);