summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2020-04-03 18:26:38 +0200
committertroido <troido@protonmail.com>2020-04-03 18:26:38 +0200
commitfd0bd24fa4e98b3bcd95a14ff844411727fb4433 (patch)
tree06e924a0f1ba31abb2e3d1cfb40d9b1f9354e01f /src/components
parent94ec558680b70ed747519d5fd787d94b74ae470d (diff)
added command line options
Diffstat (limited to 'src/components')
-rw-r--r--src/components/equipment.rs20
1 files changed, 1 insertions, 19 deletions
diff --git a/src/components/equipment.rs b/src/components/equipment.rs
index c19563f..8f7b9ab 100644
--- a/src/components/equipment.rs
+++ b/src/components/equipment.rs
@@ -1,6 +1,6 @@
use std::collections::HashMap;
-use serde_json::{json, Value};
+use serde_json::Value;
use specs::{
Component,
HashMapStorage
@@ -21,12 +21,6 @@ impl Slot {
_ => None
}
}
- pub fn to_string(&self) -> String {
- match self {
- Self::Hand => "hand",
- Self::Body => "body"
- }.to_string()
- }
}
@@ -44,12 +38,6 @@ impl Stat {
_ => None
}
}
- pub fn to_string(&self) -> String {
- match self {
- Self::Strength => "strength",
- Self::Defence => "defence"
- }.to_string()
- }
}
@@ -73,12 +61,6 @@ impl Equippable {
.collect::<Option<HashMap<Stat, i64>>>()?
})
}
- pub fn to_json(&self) -> Value {
- json!({
- "slot": self.slot.to_string(),
- "stats": self.stats.iter().map(|(k, v)| (k.to_string(), *v)).collect::<HashMap<String, i64>>()
- })
- }
}