use crate::dice::RiskDie; #[derive(Clone, Debug)] pub enum Item { Countable(String, u8), Approximate(String, RiskDie), } #[derive(Clone, Debug)] pub struct Inventory { items: Vec, } impl Inventory { pub fn new() -> Self { Self { items: Vec::new() } } pub fn size(&self) -> usize { self.items.len() } pub fn add_item(&mut self, item: Item) { self.items.push(item); } } impl Default for Inventory { fn default() -> Self { Self::new() } } #[cfg(test)] mod tests { use super::*; #[test] pub fn new_empty_inventory() { let inventory = Inventory::new(); assert_eq!(inventory.size(), 0); } }