use crate::types::GeneratedAsteroid;

pub fn summary_line(asteroid: &GeneratedAsteroid) -> String {
    match asteroid {
        GeneratedAsteroid::NearEarth(a) => {
            format!(
                "NEA: r={:.0}m, a={:.3}AU, e={:.3}",
                a.radius, a.semi_major_axis, a.eccentricity
            )
        }
        GeneratedAsteroid::MainBelt(a) => {
            format!(
                "MainBelt: r={:.0}m, a={:.3}AU, type={:?}",
                a.radius, a.semi_major_axis, a.spectral_type
            )
        }
        GeneratedAsteroid::Trojan(a) => {
            format!(
                "Trojan: r={:.0}m, point={:?}, a_host={:.3}AU",
                a.radius, a.lagrange_point, a.host_semi_major_au
            )
        }
        GeneratedAsteroid::Centaur(a) => {
            format!(
                "Centaur: r={:.0}m, a={:.3}AU, e={:.3}",
                a.radius, a.semi_major_axis, a.eccentricity
            )
        }
        GeneratedAsteroid::Binary(a) => {
            format!(
                "Binary: r1={:.0}m, r2={:.0}m, sep={:.0}m",
                a.radius_primary, a.radius_secondary, a.separation
            )
        }
        GeneratedAsteroid::RubblePile(a) => {
            format!(
                "RubblePile: r={:.0}m, porosity={:.1}%",
                a.effective_radius,
                a.porosity * 100.0
            )
        }
        GeneratedAsteroid::Metallic(a) => {
            format!(
                "Metallic: r={:.0}m, Fe={:.1}%",
                a.radius,
                a.iron_fraction * 100.0
            )
        }
        GeneratedAsteroid::PHA(a) => {
            format!(
                "PHA: r={:.0}m, MOID={:.4}AU, H={:.1}",
                a.radius, a.moid, a.absolute_mag
            )
        }
    }
}
