summaryrefslogtreecommitdiff
path: root/src/item.rs
diff options
context:
space:
mode:
authortom barrett <spalf0@gmail.com>2018-06-25 08:36:57 -0500
committertom barrett <spalf0@gmail.com>2018-06-25 08:36:57 -0500
commit39b16e379fb679aa56ded8ab5463569e5633a656 (patch)
tree446c1f2e609836c61109aa27400ac4bf2155c7dc /src/item.rs
parent7094849bf164ff6f853c8f6812a0e831a66762f3 (diff)
added item mass, allow stopping of ship, if storage is full item goes into space
Diffstat (limited to 'src/item.rs')
-rw-r--r--src/item.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/item.rs b/src/item.rs
index 90c9ed8..f9c7490 100644
--- a/src/item.rs
+++ b/src/item.rs
@@ -1,7 +1,7 @@
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Item {
pub name : String,
- size : usize,
+ pub size : usize,
}
impl Item {
@@ -11,4 +11,13 @@ impl Item {
size : size,
}
}
+
+ pub fn is_mineral(&self) -> bool {
+ if self.name == "Iron" {
+ true
+ }
+ else {
+ false
+ }
+ }
}