diff options
Diffstat (limited to 'src/encyclopedia.rs')
| -rw-r--r-- | src/encyclopedia.rs | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/src/encyclopedia.rs b/src/encyclopedia.rs index 19d4297..5cdf90c 100644 --- a/src/encyclopedia.rs +++ b/src/encyclopedia.rs @@ -12,12 +12,6 @@ pub struct Encyclopedia { impl Encyclopedia { - pub fn new() -> Encyclopedia { - Encyclopedia { - items: HashMap::new() - } - } - pub fn from_json(val: Value) -> Result<Encyclopedia, &'static str> { let mut items = HashMap::new(); for (k, v) in val.as_object().ok_or("encyclopedia not a json object")?.into_iter() { @@ -26,12 +20,6 @@ impl Encyclopedia { Ok(Encyclopedia{items}) } - pub fn add_assemblage(&mut self, name: &str, assemblage: Assemblage) -> Result<(), &'static str> { - //todo: what if name exists - self.items.insert(name.to_string(), assemblage); - Ok(()) - } - pub fn construct(&self, template: &Template) -> Result<Vec<ComponentWrapper>, &'static str> { let assemblage = self.items.get(&template.name).ok_or("unknown assemblage name")?; assemblage.instantiate(&template.args, &template.kwargs) |
