diff --git a/crates/content/src/part/outfitspace.rs b/crates/content/src/part/outfitspace.rs index 790febf..62d2ef1 100644 --- a/crates/content/src/part/outfitspace.rs +++ b/crates/content/src/part/outfitspace.rs @@ -1,4 +1,7 @@ -use std::ops::{Add, AddAssign, Sub, SubAssign}; +use std::{ + collections::HashMap, + ops::{Add, AddAssign, Sub, SubAssign}, +}; pub(crate) mod syntax { use serde::Deserialize; @@ -44,6 +47,15 @@ impl OutfitSpace { && self.weapon >= smaller.weapon && self.engine >= smaller.engine } + + /// Return a map of "space name" -> number + pub fn to_hashmap(&self) -> HashMap { + let mut m = HashMap::new(); + m.insert("outfit".to_string(), self.outfit); + m.insert("weapon".to_string(), self.weapon); + m.insert("engine".to_string(), self.engine); + m + } } impl Sub for OutfitSpace {