summaryrefslogtreecommitdiff
path: root/src/item.rs
diff options
context:
space:
mode:
authortom barrett <spalf0@gmail.com>2019-02-13 13:25:00 -0600
committertom barrett <spalf0@gmail.com>2019-02-13 13:25:00 -0600
commit284cac8f4034f15e7edeba5c8232a770fc082e20 (patch)
tree8f73230bae89c3bf796e47f7c52ac84f7015bd09 /src/item.rs
parent070485e093dc540a5db9650d438cffe3d18d3883 (diff)
added engine fuel and simplified/unified txrx from server
Diffstat (limited to 'src/item.rs')
-rw-r--r--src/item.rs4
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(),