use fastrand::Rng;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use strum::{EnumIter, IntoEnumIterator};

#[derive(Clone, Copy, Serialize, Deserialize, JsonSchema, EnumIter)]
pub enum Kind {
    Planet,
    Star,
    Nova,
    Banana,
    Station,
}

impl Kind {
    pub fn random(seed: u64) -> Self {
        let mut rng = Rng::with_seed(seed);
        rng.choice(Self::iter()).unwrap_or(Self::Star)
    }
}
