#[derive(Debug, Clone, Copy, PartialEq)]
pub struct IceDeposit {
    pub region_name: &'static str,
    pub estimated_mass_kg: f64,
    pub purity_fraction: f64,
}

impl IceDeposit {
    pub fn extractable_water_kg(&self, recovery_efficiency: f64) -> f64 {
        self.estimated_mass_kg * self.purity_fraction * recovery_efficiency.clamp(0.0, 1.0)
    }
}

pub fn subsurface_ocean() -> IceDeposit {
    IceDeposit {
        region_name: "Subsurface Ocean",
        estimated_mass_kg: 3.0e21,
        purity_fraction: 0.85,
    }
}

pub fn annual_life_support_people(deposit: IceDeposit, kg_per_person_per_year: f64) -> f64 {
    deposit.extractable_water_kg(0.7) / kg_per_person_per_year.max(1.0)
}
