class_name BiomeGenerationClass
extends Node

# Generate environmental maps
static func generate_environment_maps(width: int, height: int) -> Dictionary:
	var moisture_noise = FastNoiseLite.new()
	moisture_noise.seed = 12345
	moisture_noise.frequency = 0.02

	var temperature_noise = FastNoiseLite.new()
	temperature_noise.seed = 54321
	temperature_noise.frequency = 0.015

	var elevation_noise = FastNoiseLite.new()
	elevation_noise.seed = 98765
	elevation_noise.frequency = 0.01

	var maps = {}
	maps.moisture = Image.create(width, height, false, Image.FORMAT_RF)
	maps.temperature = Image.create(width, height, false, Image.FORMAT_RF)
	maps.elevation = Image.create(width, height, false, Image.FORMAT_RF)

	for x in range(width):
			for y in range(height):
					var moisture = (moisture_noise.get_noise_2d(x, y) + 1.0) * 0.5
					var temperature = (temperature_noise.get_noise_2d(x, y) + 1.0) * 0.5
					var elevation = (elevation_noise.get_noise_2d(x, y) + 1.0) * 0.5
					
					maps.moisture.set_pixel(x, y, Color(moisture, 0, 0, 1))
					maps.temperature.set_pixel(x, y, Color(temperature, 0, 0, 1))
					maps.elevation.set_pixel(x, y, Color(elevation, 0, 0, 1))

	Global.biome_data = maps
	
	return maps
