public static void SidesOcean(HexagonCollection collection, WorldGenParamters world) { List <int> rows = new List <int>() { 0, 1, world.MaxRows - 2, world.MaxRows - 1 }; foreach (int row in rows) { for (int col = 0; col < world.MaxCol; col++) { collection.Get(row, col).Elevation = -500; } } List <int> cols = new List <int>() { 0, world.MaxCol - 1 }; foreach (int col in cols) { for (int row = 0; row < world.MaxRows; row++) { var hex = collection.Get(row, col); hex.Elevation = -500; hex.Terrain.TerrainEnum = TerrainEnum.Grassland; } } }
public static HexagonCollection GenerateWorld(WorldGenParamters world) { var collection = MakeDefaultHexagons(world.MaxRows, world.MaxCol, world.WrapEastWest); CenterSeed(collection, world); if (world.WaterSurrounds) { SidesOcean(collection, world); } TerrainController.FillAll(collection, world.MaxRows); return(collection); }
public static void CenterSeed(HexagonCollection collection, WorldGenParamters world) { collection.Get(world.MaxRows / 2, world.MaxCol / 2).Terrain = Terrain.EnumMap[TerrainEnum.Grassland]; }