From 22c18205bcb3702ddf60f41f77f6f06554202f35 Mon Sep 17 00:00:00 2001 From: Katharina Fey Date: Sun, 22 Mar 2020 19:44:26 +0100 Subject: Updating gameplay starting mechanics, adding quadtree to map --- src/wire/mod.rs | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'src/wire/mod.rs') diff --git a/src/wire/mod.rs b/src/wire/mod.rs index bf8dea0e8131..b1c231b44580 100644 --- a/src/wire/mod.rs +++ b/src/wire/mod.rs @@ -23,7 +23,7 @@ use serde::{Deserialize, Serialize}; pub type UserId = usize; /// Represents a user payload -#[derive(Clone, Serialize, Deserialize)] +#[derive(Copy, Clone, Serialize, Deserialize)] pub struct User { /// The internal user ID pub id: UserId, @@ -34,7 +34,7 @@ pub struct User { } /// A more lobby specific abstraction for a user -#[derive(Serialize, Deserialize)] +#[derive(Clone, Serialize, Deserialize)] pub struct LobbyUser { /// The user ID pub id: UserId, @@ -42,6 +42,8 @@ pub struct LobbyUser { pub name: String, /// Are they ready? pub ready: bool, + /// Are they the lobby admin? + pub admin: bool, /// The colour they will be in the match pub color: Color, } @@ -50,7 +52,7 @@ pub struct LobbyUser { pub type LobbyId = usize; /// Represent a lobby -#[derive(Serialize, Deserialize)] +#[derive(Clone, Serialize, Deserialize)] pub struct Lobby { /// The ID of the lobby pub id: LobbyId, @@ -65,19 +67,4 @@ pub struct Lobby { /// An alias for a match ID pub type MatchId = usize; -/// Mapping users to a player in game -#[derive(Serialize, Deserialize)] -pub struct MatchUser { - pub user: User, - pub player: Player, -} -#[derive(Serialize, Deserialize)] -pub struct Match { - /// The match id - pub id: MatchId, - /// The list of active players - pub players: Vec, - /// The active game map - pub map: Map, -} -- cgit v1.2.3