diff options
author | metamuffin <metamuffin@disroot.org> | 2024-07-10 21:54:03 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-07-10 21:54:03 +0200 |
commit | 61533450cba864f49653aed4021fedf39477c8fd (patch) | |
tree | 129e99eb7b6ab34cfd098fa854463b9d1a41f5b8 /server/src/data.rs | |
parent | 552711488539d651283bb8573a35aff737c8b132 (diff) | |
download | hurrycurry-61533450cba864f49653aed4021fedf39477c8fd.tar hurrycurry-61533450cba864f49653aed4021fedf39477c8fd.tar.bz2 hurrycurry-61533450cba864f49653aed4021fedf39477c8fd.tar.zst |
quick reload command
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, |