summaryrefslogtreecommitdiff
path: root/src/storage.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/storage.rs')
-rw-r--r--src/storage.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/storage.rs b/src/storage.rs
index 3e900b2..6aa8417 100644
--- a/src/storage.rs
+++ b/src/storage.rs
@@ -14,6 +14,13 @@ impl Storage {
}
}
+ pub fn has_minerals(&self) -> bool {
+ match self.items.iter().position(|item| item.name == "Iron") {
+ Some(_) => true,
+ None => false,
+ }
+ }
+
pub fn take(&mut self, name : &str) -> Option<Item> {
match self.items.iter().position(|item| item.name == name) {
Some(index) => Some(self.items.remove(index)),