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

#[derive(JsonSchema, Serialize, Deserialize)]
pub struct Size {
    pub small_item_multiplier: u8,
    pub large_item_multiplier: u8,
    pub small_item: String,
    pub large_item: String,
}

impl Size {
    pub fn random(seed: u64) -> Self {
        let mut rand = Rng::with_seed(seed);

        // multipliers:
        // this planet is as large as 10 x item
        let range = 1..99;
        Self {
            small_item_multiplier: rand.choice(range.clone()).unwrap_or(1),
            large_item_multiplier: rand.choice(range.clone()).unwrap_or(1),
            small_item: "rats".into(),
            large_item: "ohios".into(),
        }
    }
}
