#ifndef WEATHER_MANAGER_HPP_
#define WEATHER_MANAGER_HPP_

#include <FractalNoise1D/FractalNoise1D.hpp>
#include <GeneratorNode/GeneratorNode.hpp>
#include <Perlin1D/Perlin1D.hpp>
#include <Utilities/Extern.hpp>

class World;
class ChunkWindow;

class WeatherManager final
{
private:
    FractalNoise1D temperatureNoise;
    FractalNoise1D humidityNoise;

    World &world;
    Uint32 lastSpawnTicks;

    static constexpr float topParticlesPerSecond = 5000.0f;

    float getCloudThreshold(float temperature);

public:
    GeneratorNode genNode;

    WeatherManager(World &world);

    void init(GeneratorNode genNode);
    float getTemperature();
    float getHumidity();
    float getCloudCover();
    float getRainIntensity();
    void applyEffects(ChunkWindow &window);
};

#endif