Example #1
0
        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);
        }
Example #2
0
        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));
        }
Example #3
0
 /// <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>();
 }
Example #4
0
 /// <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>();
 }
Example #5
0
 public abstract Map generate(MapConfiguration config);
Example #6
0
 public abstract Map generate(MapConfiguration config);