public Overworld.MapData[,] CreateMap() { int sx = Biomes.GetLength(0); int sy = Biomes.GetLength(1); Overworld.MapData[,] toReturn = new Overworld.MapData[Biomes.GetLength(0), Biomes.GetLength(1)]; for (int x = 0; x < sx; x++) { for (int y = 0; y < sy; y++) { toReturn[x, y] = new Overworld.MapData { Biome = (Overworld.Biome)Biomes[x, y], Erosion = Erosion[x, y], Faults = Faults[x, y], Height = Height[x, y], Rainfall = Rainfall[x, y], Temperature = Temperature[x, y], Water = (Overworld.WaterType)(Water[x, y]), Weathering = Weathering[x, y] }; } } return(toReturn); }
public OverworldData(Overworld.MapData[,] map, string name) { int sizeX = map.GetLength(0); int sizeY = map.GetLength(1); Biomes = new int[sizeX, sizeY]; Erosion = new float[sizeX, sizeY]; Faults = new float[sizeX, sizeY]; Rainfall = new float[sizeX, sizeY]; Temperature = new float[sizeX, sizeY]; Water = new int[sizeX, sizeY]; Weathering = new float[sizeX, sizeY]; Height = new float[sizeX, sizeY]; Name = name; for (int x = 0; x < sizeX; x++) { for (int y = 0; y < sizeY; y++) { Overworld.MapData data = map[x, y]; Biomes[x, y] = (int)data.Biome; Erosion[x, y] = (data.Erosion); Faults[x, y] = (data.Faults); Height[x, y] = (data.Height); Rainfall[x, y] = (data.Rainfall); Temperature[x, y] = (data.Temperature); Water[x, y] = (int)(data.Water); Weathering[x, y] = (data.Weathering); } } Screenshot = CreateTexture(PlayState.Game.GraphicsDevice, sizeX, sizeY); }
public OverworldData(GraphicsDevice device, Overworld.MapData[,] map, string name, float seaLevel) { int sizeX = map.GetLength(0); int sizeY = map.GetLength(1); Biomes = new int[sizeX, sizeY]; Erosion = new float[sizeX, sizeY]; Faults = new float[sizeX, sizeY]; Rainfall = new float[sizeX, sizeY]; Temperature = new float[sizeX, sizeY]; Water = new int[sizeX, sizeY]; Weathering = new float[sizeX, sizeY]; Height = new float[sizeX, sizeY]; Factions = new byte[sizeX, sizeY]; Name = name; SeaLevel = seaLevel; for (int x = 0; x < sizeX; x++) { for (int y = 0; y < sizeY; y++) { Overworld.MapData data = map[x, y]; Biomes[x, y] = (int)data.Biome; Erosion[x, y] = (data.Erosion); Faults[x, y] = (data.Faults); Height[x, y] = (data.Height); Rainfall[x, y] = (data.Rainfall); Temperature[x, y] = (data.Temperature); Water[x, y] = (int)(data.Water); Weathering[x, y] = (data.Weathering); Factions[x, y] = data.Faction; } } Screenshot = CreateTexture(device, sizeX, sizeY, seaLevel); FactionList = new List <FactionDescriptor>(); byte id = 0; foreach (Faction f in Overworld.NativeFactions) { FactionList.Add(new FactionDescriptor() { Name = f.Name, PrimaryColory = f.PrimaryColor, SecondaryColor = f.SecondaryColor, Id = id, Race = f.Race.Name, CenterX = f.Center.X, CenterY = f.Center.Y, }); id++; } }
public Overworld.MapData[,] CreateMap() { int sx = Biomes.GetLength(0); int sy = Biomes.GetLength(1); Overworld.MapData[,] toReturn = new Overworld.MapData[Biomes.GetLength(0), Biomes.GetLength(1)]; for(int x = 0; x < sx; x++) { for(int y = 0; y < sy; y++) { toReturn[x, y] = new Overworld.MapData { Biome = (Overworld.Biome) Biomes[x, y], Erosion = Erosion[x, y], Faults = Faults[x, y], Height = Height[x, y], Rainfall = Rainfall[x, y], Temperature = Temperature[x, y], Water = (Overworld.WaterType) (Water[x, y]), Weathering = Weathering[x, y] }; } } return toReturn; }