diff options
Diffstat (limited to 'server/src/data.rs')
-rw-r--r-- | server/src/data.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/server/src/data.rs b/server/src/data.rs index 9fd3e95c..5f35a360 100644 --- a/server/src/data.rs +++ b/server/src/data.rs @@ -100,6 +100,7 @@ pub struct Demand { #[derive(Debug, Clone, Serialize, Deserialize, Default)] #[rustfmt::skip] pub struct Gamedata { + pub spec: String, pub item_names: Vec<String>, pub tile_names: Vec<String>, pub tile_collide: Vec<bool>, @@ -165,7 +166,7 @@ impl DataIndex { let demands_in = serde_yaml::from_str(&self.read_demands(demands).await?)?; let recipes_in = serde_yaml::from_str(&self.read_recipes(recipes).await?)?; - let mut gd = Gamedata::build(map_in, demands_in, recipes_in)?; + let mut gd = Gamedata::build(spec, map_in, demands_in, recipes_in)?; gd.map_names = self.maps.clone(); Ok(gd) } @@ -173,6 +174,7 @@ impl DataIndex { impl Gamedata { pub fn build( + spec: String, map_in: InitialMap, demands_in: Vec<DemandDecl>, recipes_in: Vec<RecipeDecl>, @@ -281,6 +283,7 @@ impl Gamedata { ); Ok(Gamedata { + spec, demands, tile_collide, tile_interact, |