From 284cac8f4034f15e7edeba5c8232a770fc082e20 Mon Sep 17 00:00:00 2001 From: tom barrett Date: Wed, 13 Feb 2019 13:25:00 -0600 Subject: added engine fuel and simplified/unified txrx from server --- src/item.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/item.rs') 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(), -- cgit v1.2.3