diff options
Diffstat (limited to 'src/item.rs')
-rw-r--r-- | src/item.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/item.rs b/src/item.rs index 0d655e4..1e0e7ab 100644 --- a/src/item.rs +++ b/src/item.rs @@ -5,6 +5,7 @@ use crate::math::rand_name; pub enum ItemType { CrudeMinerals, Iron, + Hydrogen, } #[derive(Serialize, Deserialize, Debug, Clone)] @@ -17,8 +18,9 @@ pub struct Item { impl Item { pub fn new(itemtype: ItemType) -> Item { let size = match itemtype { - ItemType::CrudeMinerals => constants::CRUDE_MINERALS_SIZE, ItemType::Iron => constants::IRON_SIZE, + ItemType::Hydrogen => constants::HYDROGEN_SIZE, + ItemType::CrudeMinerals => constants::CRUDE_MINERALS_SIZE, }; Item { name: serde_json::to_string(&itemtype).unwrap() + &rand_name(), |