From ae29ca99dde89f8b975ce7b3a716411ab2028e50 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Thu, 11 Jul 2024 13:48:42 +0200 Subject: send map metadata --- server/protocol/src/lib.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'server/protocol/src/lib.rs') 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, pub tile_collide: Vec, pub tile_interact: Vec, - pub map_names: HashSet, + pub maps: HashMap, } #[derive(Debug, Clone, Serialize, Deserialize)] -- cgit v1.2.3-70-g09d2