#[derive(Debug, Clone)]
pub struct Region {
    pub name: String,
    pub regiontype: RegionType,
    pub boundary: Vec<[f64; 2]>,
    pub areakm2: f64,
}

#[derive(Debug, Clone, Copy, PartialEq)]
pub enum RegionType {
    AtmosphericBand,
    VortexRegion,
    PolarCap,
    StormSystem,
    CloudFeature,
}

pub struct RegionDatabase {
    pub regions: Vec<Region>,
}

impl RegionDatabase {
    pub fn atmosphericbands() -> Self {
        Self {
            regions: vec![
                Region {
                    name: "North Polar Region".into(),
                    regiontype: RegionType::PolarCap,
                    boundary: vec![
                        [70.0, -180.0],
                        [70.0, -90.0],
                        [70.0, 0.0],
                        [70.0, 90.0],
                        [70.0, 180.0],
                        [90.0, 180.0],
                        [90.0, -180.0],
                    ],
                    areakm2: 2.4e8,
                },
                Region {
                    name: "North Temperate Band".into(),
                    regiontype: RegionType::AtmosphericBand,
                    boundary: vec![[30.0, -180.0], [30.0, 180.0], [70.0, 180.0], [70.0, -180.0]],
                    areakm2: 8.5e8,
                },
                Region {
                    name: "Equatorial Zone".into(),
                    regiontype: RegionType::AtmosphericBand,
                    boundary: vec![
                        [-30.0, -180.0],
                        [-30.0, 180.0],
                        [30.0, 180.0],
                        [30.0, -180.0],
                    ],
                    areakm2: 1.9e9,
                },
                Region {
                    name: "South Temperate Band".into(),
                    regiontype: RegionType::AtmosphericBand,
                    boundary: vec![
                        [-70.0, -180.0],
                        [-70.0, 180.0],
                        [-30.0, 180.0],
                        [-30.0, -180.0],
                    ],
                    areakm2: 8.5e8,
                },
                Region {
                    name: "South Polar Region".into(),
                    regiontype: RegionType::PolarCap,
                    boundary: vec![
                        [-90.0, -180.0],
                        [-90.0, 180.0],
                        [-70.0, 180.0],
                        [-70.0, -180.0],
                    ],
                    areakm2: 2.4e8,
                },
                Region {
                    name: "Great Dark Spot".into(),
                    regiontype: RegionType::StormSystem,
                    boundary: vec![
                        [-30.0, 280.0],
                        [-30.0, 310.0],
                        [-15.0, 310.0],
                        [-15.0, 280.0],
                    ],
                    areakm2: 1.3e7,
                },
                Region {
                    name: "Small Dark Spot".into(),
                    regiontype: RegionType::StormSystem,
                    boundary: vec![
                        [-58.0, 330.0],
                        [-58.0, 350.0],
                        [-50.0, 350.0],
                        [-50.0, 330.0],
                    ],
                    areakm2: 3.0e6,
                },
            ],
        }
    }
}
