#[derive(Default)]
pub enum BodyId {
    SSB,
    SUN,

    MERCURYB,
    MERCURY,

    VENUSB,
    VENUS,

    EMB,
    #[default]
    EARTH,
    MOON,

    MARSB,
    MARS,
    PHOBOS,
    DEIMOS,

    JUPITERB,
    JUPITER,
    IO,
    EUROPA,
    GANYMEDE,
    CALLISTO,

    SATURNB,
    SATURN,
    MIMAS,
    ENCELADUS,
    TETHYS,
    DIONE,
    RHEA,
    TITAN,
    HYPERION,
    IAPETUS,

    URANUSB,
    URANUS,
    ARIEL,
    UMBRIEL,
    TITANIA,
    OBERON,
    MMIRANDA,

    NEPTUNEB,
    NEPTUNE,

}

/*pub fn name(id: BodyId) -> &'static str {
    match id {
        BodyId::Sun => "Sun",

        // Planets.
        BodyId::Mercury => "Mercury",
        BodyId::Venus => "Venus",
        BodyId::Earth => "Earth",
        BodyId::Mars => "Mars",
        BodyId::Jupiter => "Jupiter",
        BodyId::Saturn => "Saturn",
        BodyId::Uranus => "Uranus",
        BodyId::Neptune => "Neptune",
        BodyId::Pluto => "Pluto",

        // Barycenters.
        BodyId::SolarSystemBarycenter => "Solar System Barycenter",
        BodyId::MercuryBarycenter => "Mercury Barycenter",
        BodyId::VenusBarycenter => "Venus Barycenter",
        BodyId::EarthBarycenter => "Earth Barycenter",
        BodyId::MarsBarycenter => "Mars Barycenter",
        BodyId::JupiterBarycenter => "Jupiter Barycenter",
        BodyId::SaturnBarycenter => "Saturn Barycenter",
        BodyId::UranusBarycenter => "Uranus Barycenter",
        BodyId::NeptuneBarycenter => "Neptune Barycenter",
        BodyId::PlutoBarycenter => "Pluto Barycenter",

        // Satellites.
        BodyId::Moon => "Moon",
        BodyId::Phobos => "Phobos",
        BodyId::Deimos => "Deimos",
    }
}*/

pub fn from_str(s: &str) -> BodyId {
    match s {
        "sun" | "Sun" => BodyId::Sun,
        "ssb" | "SSB" | "solar system barycenter" | "Solar System Barycenter" => {
            BodyId::SolarSystemBarycenter
        }
        "mercury barycenter" | "Mercury Barycenter" => BodyId::MercuryBarycenter,
        "venus barycenter" | "Venus Barycenter" => BodyId::VenusBarycenter,
        "earth barycenter" | "Earth Barycenter" => BodyId::EarthBarycenter,
        "mars barycenter" | "Mars Barycenter" => BodyId::MarsBarycenter,
        "jupiter barycenter" | "Jupiter Barycenter" => BodyId::JupiterBarycenter,
        "saturn barycenter" | "Saturn Barycenter" => BodyId::SaturnBarycenter,
        "uranus barycenter" | "Uranus Barycenter" => BodyId::UranusBarycenter,
        "neptune barycenter" | "Neptune Barycenter" => BodyId::NeptuneBarycenter,
        "pluto barycenter" | "Pluto Barycenter" => BodyId::PlutoBarycenter,
        "mercury" | "Mercury" => BodyId::Mercury,
        "venus" | "Venus" => BodyId::Venus,
        "earth" | "Earth" => BodyId::Earth,
        "mars" | "Mars" => BodyId::Mars,
        "jupiter" | "Jupiter" => BodyId::Jupiter,
        "saturn" | "Saturn" => BodyId::Saturn,
        "uranus" | "Uranus" => BodyId::Uranus,
        "neptune" | "Neptune" => BodyId::Neptune,
        "pluto" | "Pluto" => BodyId::Pluto,
        "moon" | "Moon" | "luna" | "Luna" => BodyId::Moon,
        "phobos" | "Phobos" => BodyId::Phobos,
        "deimos" | "Deimos" => BodyId::Deimos,
        _ => BodyId::Sun,
    }
}
