#pragma once

#include "../WorldGenerationFunctions/IWorldGenerationFunction.h"
#include "../WorldData.h"
#include "map/GMap.h"

namespace warfactory {

/**
 * @brief Initialize world terrain with starting conditions
 *
 * Sets initial surface temperature and elevation across the entire world map
 * based on parameters from Phase 0 configuration.
 */
class InitializeWorldTerrainFunction : public IWorldGenerationFunction {
private:
    float surface_temperature_celsius;
    float surface_elevation_meters;
    int world_width;
    int world_height;

public:
    InitializeWorldTerrainFunction();

    // Inherited from IWorldGenerationFunction
    void configure(const IDataNode& config) override;
    void execute(WorldData& world, PlanetaryCore& core) override;
    std::string getStepName() const override;
    bool isConfigured() const override;
    void reset() override;

private:
    /**
     * @brief Initialize terrain map with uniform values
     */
    void initializeTerrainMap(GMap* terrain_map);

    /**
     * @brief Set initial temperature across the world
     */
    void setInitialTemperature(WorldData& world);
};

} // namespace warfactory