diff options
author | metamuffin <metamuffin@disroot.org> | 2024-07-11 13:48:42 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-07-11 13:48:42 +0200 |
commit | ae29ca99dde89f8b975ce7b3a716411ab2028e50 (patch) | |
tree | 0ecd0107dda055f9e5f4391d1df545f662a98920 /server/protocol | |
parent | 42900ac1c14712f181a9719a85d9df879e15ef29 (diff) | |
download | hurrycurry-ae29ca99dde89f8b975ce7b3a716411ab2028e50.tar hurrycurry-ae29ca99dde89f8b975ce7b3a716411ab2028e50.tar.bz2 hurrycurry-ae29ca99dde89f8b975ce7b3a716411ab2028e50.tar.zst |
send map metadata
Diffstat (limited to 'server/protocol')
-rw-r--r-- | server/protocol/src/lib.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/server/protocol/src/lib.rs b/server/protocol/src/lib.rs index 147a4fc3..cb72d2ff 100644 --- a/server/protocol/src/lib.rs +++ b/server/protocol/src/lib.rs @@ -17,7 +17,7 @@ */ use glam::{IVec2, Vec2}; use serde::{Deserialize, Serialize}; -use std::{collections::HashSet, fmt::Display}; +use std::{collections::HashMap, fmt::Display}; pub use glam; @@ -38,6 +38,13 @@ pub struct RecipeIndex(pub usize); #[serde(transparent)] pub struct DemandIndex(pub usize); +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct MapMetadata { + name: String, + players: usize, + difficulty: i32, +} + #[derive(Debug, Clone, Serialize, Deserialize, Default)] #[rustfmt::skip] pub struct ClientGamedata { @@ -45,7 +52,7 @@ pub struct ClientGamedata { pub tile_names: Vec<String>, pub tile_collide: Vec<bool>, pub tile_interact: Vec<bool>, - pub map_names: HashSet<String>, + pub maps: HashMap<String, MapMetadata>, } #[derive(Debug, Clone, Serialize, Deserialize)] |