public BiomMapGenerator(Random random, BiomModel[,] biomes, GroundNoiseMapParametersModel temperatureNoiseMapParameters, GroundNoiseMapParametersModel heightNoiseMapParameters) { this.temperatureNoiseMapParameters = temperatureNoiseMapParameters; this.heightNoiseMapParameters = heightNoiseMapParameters; this.biomes = biomes; noiseGenerator = new NoiseMapGenerator(random); }
public Generator(int width, int height, int seed, WaterBiomModel[] waterBiomes, BiomModel[,] biomes, WaterNoiseMapParametersModel waterNoiseMapParameters, GroundNoiseMapParametersModel heightNoiseMapParameters, GroundNoiseMapParametersModel temperatureNoiseMapParameters) { this.biomes = biomes; this.waterBiomes = waterBiomes; this.waterNoiseMapParameters = waterNoiseMapParameters; this.heightNoiseMapParameters = heightNoiseMapParameters; this.temperatureNoiseMapParameters = temperatureNoiseMapParameters; random = new Random(seed); Map = new TilesMap(width, height); }
private float ScaleValue(float value, float minValue, float maxValue, GroundNoiseMapParametersModel noiseMapParameters) { float result = ((value - minValue) * (noiseMapParameters.MaxValue - noiseMapParameters.MinValue) / (maxValue - minValue) + noiseMapParameters.MinValue); return(Clamp(result, 0, 0.9999999f)); }