diff options
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/equipment.rs | 20 |
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>>() - }) - } } |
