private void InitTerrain(int terrainSeed, int numberSeed, bool randomNumbers)
{
// generate random board
// construct pool
List<Terrain> terrainPool = new List<Terrain>(19);
for (int i = 0; i < 4; i++)
{
if (i < 3) terrainPool.Add(Terrain.Hills);
if (i < 3) terrainPool.Add(Terrain.Mountains);
terrainPool.Add(Terrain.Pasture);
terrainPool.Add(Terrain.Fields);
terrainPool.Add(Terrain.Forest);
}
terrainPool.Add(Terrain.Desert);
List<int> numberPool = new List<int>(valueOrder);
List<HarborType> harborPool = new List<HarborType>(9);
harborPool.Add(HarborType.Brick);
harborPool.Add(HarborType.Grain);
harborPool.Add(HarborType.Lumber);
harborPool.Add(HarborType.Ore);
harborPool.Add(HarborType.Wool);
for(int i = 0; i < 4; i++) harborPool.Add(HarborType.ThreeForOne);
// shuffles
terrainPool.Shuffle(terrainSeed);
harborPool.Shuffle(terrainSeed);
if (randomNumbers) numberPool.Shuffle(numberSeed);
// place randomized tiles
bool desertFound = false;
for (int i = 0; i < placementOrder.Length; i++)
{
Tuple<int, int> coords = GetTerrainCoords(placementOrder[i]);
if (terrainPool[i] == Terrain.Desert)
{
terrain[coords.Item1][coords.Item2] = new Tile(terrainPool[i], 0);
desertFound = true;
robberLocation = placementOrder[i]; // place the robber
}
else
{
terrain[coords.Item1][coords.Item2] = new Tile(terrainPool[i], numberPool[i - (desertFound ? 1 : 0)]);
}
}
// place harbors random at positions
for (int i = 0; i < 9; i++) this.harbors[i] = new Harbor(harborPool[i], harborEdges[i]);
}