aboutsummaryrefslogtreecommitdiff
path: root/server/src/data.rs
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/data.rs')
-rw-r--r--server/src/data.rs20
1 files changed, 12 insertions, 8 deletions
diff --git a/server/src/data.rs b/server/src/data.rs
index 46f7ed28..62a7f5d8 100644
--- a/server/src/data.rs
+++ b/server/src/data.rs
@@ -16,6 +16,7 @@
*/
use crate::{
+ entity::EntityDecl,
interaction::Recipe,
protocol::{DemandIndex, ItemIndex, RecipeIndex, TileIndex},
};
@@ -64,11 +65,14 @@ pub struct RecipeDecl {
pub struct InitialMap {
map: Vec<String>,
tiles: HashMap<char, String>,
+ #[serde(default)]
items: HashMap<char, String>,
collider: Vec<String>,
walkable: Vec<String>,
chef_spawn: char,
customer_spawn: char,
+ #[serde(default)]
+ entities: Vec<EntityDecl>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -88,19 +92,18 @@ pub struct Demand {
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
+#[rustfmt::skip]
pub struct Gamedata {
- #[serde(skip)]
- pub recipes: Vec<Recipe>,
- #[serde(skip)]
- pub demands: Vec<Demand>,
pub item_names: Vec<String>,
pub tile_names: Vec<String>,
pub tile_collide: Vec<bool>,
pub tile_interact: Vec<bool>,
- #[serde(skip)]
- pub initial_map: HashMap<IVec2, (TileIndex, Option<ItemIndex>)>,
- pub chef_spawn: Vec2,
- pub customer_spawn: Vec2,
+ #[serde(skip)] pub recipes: Vec<Recipe>,
+ #[serde(skip)] pub demands: Vec<Demand>,
+ #[serde(skip)] pub initial_map: HashMap<IVec2, (TileIndex, Option<ItemIndex>)>,
+ #[serde(skip)] pub chef_spawn: Vec2,
+ #[serde(skip)] pub customer_spawn: Vec2,
+ #[serde(skip)] pub entities: Vec<EntityDecl>,
}
#[derive(Debug, Deserialize, Default)]
@@ -258,6 +261,7 @@ impl Gamedata {
recipes,
initial_map,
item_names,
+ entities: map_in.entities,
tile_names,
chef_spawn,
customer_spawn,