#ifndef ENVIRONMENT_H
#define ENVIRONMENT_H

/**
 * @brief Models atmospheric and gravitational conditions for the flight simulation.
 *
 * The Environment class provides atmospheric properties (air density, pressure, temperature)
 * and gravity based on altitude. Future versions may support wind models.
 */
class Environment {
    public:
        /**
         * @brief Constructs a new Environment.
         * @param surfacePressure Surface pressure at launch site (Pascals).
         * @param surfaceTemperature Surface temperature at launch site (Kelvin).
         * @param launchAltitude Launch site altitude (meters above sea level).
         */
        Environment(double surfacePressure,
                    double surfaceTemperature,
                    double launchAltitude);
    
        /**
         * @brief Default destructor.
         */
        ~Environment() = default;
    
        /**
         * @brief Returns the atmospheric density at a given altitude.
         * @param altitude Altitude above sea level (meters).
         * @return Air density in kg/m3.
         */
        double getAirDensity(double altitude) const;
    
        /**
         * @brief Returns the gravitational acceleration at a given altitude.
         * @param altitude Altitude above sea level (meters).
         * @return Gravitational acceleration in m/s2.
         */
        double getGravity(double altitude) const;
    
        /**
         * @brief Returns the surface pressure at launch site.
         * @return Pressure in Pascals.
         */
        double getSurfacePressure() const;
    
        /**
         * @brief Returns the surface temperature at launch site.
         * @return Temperature in Kelvin.
         */
        double getSurfaceTemperature() const;
    
        /**
         * @brief Returns the launch altitude above sea level.
         * @return Altitude in meters.
         */
        double getLaunchAltitude() const;
    
    private:
        double surfacePressure_; ///< Surface pressure at launch site [Pa].
        double surfaceTemperature_; ///< Surface temperature at launch site [K].
        double launchAltitude_; ///< Launch altitude above sea level [m].
    
        /**
         * @brief Internal method to compute standard atmosphere temperature at altitude.
         * @param altitude Altitude above sea level (meters).
         * @return Temperature at altitude (Kelvin).
         */
        double getStandardTemperature(double altitude) const;
    
        /**
         * @brief Internal method to compute standard atmosphere pressure at altitude.
         * @param altitude Altitude above sea level (meters).
         * @return Pressure at altitude (Pascals).
         */
        double getStandardPressure(double altitude) const;
    };

#endif // ENVIRONMENT_H