summaryrefslogtreecommitdiff
path: root/src/item.rs
diff options
context:
space:
mode:
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
+ }
+ }
}