M client/src/game_status/mod.rs => client/src/game_status/mod.rs +2 -1
@@ 42,7 42,7 @@ pub struct SupplyPile {
pub amount: usize,
}
-#[derive(Deserialize, Serialize, Clone, Copy, PartialEq)]
+#[derive(Debug, Deserialize, Serialize, Clone, Copy, PartialEq)]
pub enum PlayerState {
/// e.g. not their turn
Idle,
@@ 53,6 53,7 @@ pub enum PlayerState {
}
pub struct PlayerStatus {
+ pub display_name: String,
pub state: PlayerState,
pub plays: i16,
pub buys: i16,
M client/src/game_status/parser.rs => client/src/game_status/parser.rs +2 -0
@@ 51,6 51,7 @@ pub fn parse(game: &Game) -> Result<GameStatus, ()> {
game_status.players.insert(
game.host_id.clone(),
PlayerStatus {
+ display_name: game.host.as_ref().unwrap().username.clone(),
state: PlayerState::Idle,
plays: 0,
buys: 0,
@@ 65,6 66,7 @@ pub fn parse(game: &Game) -> Result<GameStatus, ()> {
game_status.players.insert(
game.guest_id.clone(),
PlayerStatus {
+ display_name: game.guest.as_ref().unwrap().username.clone(),
state: PlayerState::Idle,
plays: 0,
buys: 0,