DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

4821381e1b41e589b30b538cf9a179bc0c3f6021 — Jonni Liljamo 1 year, 7 months ago 9da70be
feat(client): display_name for player, debug state
2 files changed, 4 insertions(+), 1 deletions(-)

M client/src/game_status/mod.rs
M client/src/game_status/parser.rs
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,