Added outfitspace to_hashmap
parent
ab17930449
commit
f5c9540fb7
|
@ -1,4 +1,7 @@
|
||||||
use std::ops::{Add, AddAssign, Sub, SubAssign};
|
use std::{
|
||||||
|
collections::HashMap,
|
||||||
|
ops::{Add, AddAssign, Sub, SubAssign},
|
||||||
|
};
|
||||||
|
|
||||||
pub(crate) mod syntax {
|
pub(crate) mod syntax {
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
@ -44,6 +47,15 @@ impl OutfitSpace {
|
||||||
&& self.weapon >= smaller.weapon
|
&& self.weapon >= smaller.weapon
|
||||||
&& self.engine >= smaller.engine
|
&& self.engine >= smaller.engine
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Return a map of "space name" -> number
|
||||||
|
pub fn to_hashmap(&self) -> HashMap<String, u32> {
|
||||||
|
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 {
|
impl Sub for OutfitSpace {
|
||||||
|
|
Loading…
Reference in New Issue