diff options
Diffstat (limited to 'src/types.rs')
-rw-r--r-- | src/types.rs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/types.rs b/src/types.rs index 84e7d46..d467982 100644 --- a/src/types.rs +++ b/src/types.rs @@ -10,6 +10,7 @@ use std::{ }; use warp::ws::Message; use tokio::sync::RwLock; +use serde::Serialize; use crate::minesweeper; #[derive(Debug, Clone)] @@ -23,15 +24,19 @@ pub struct Config { pub socket_addr: SocketAddr, } -#[derive(Debug)] -pub struct Room { +#[derive(Debug, Serialize)] +pub struct RoomConf { pub name: String, - pub players: PlayerMap, - pub peer_limit: usize, + pub player_cap: usize, pub public: bool, + pub board_conf: minesweeper::BoardConf, +} + +pub struct Room { + pub conf: RoomConf, + pub players: PlayerMap, pub driver: tokio::task::JoinHandle<()>, pub cmd_stream: CmdTx, - pub board_conf: minesweeper::BoardConf, } #[derive(Debug)] |