Skip to main content

api/dto/
player_state.rs

1use serde::{Deserialize, Serialize};
2
3use super::{CardDTO, ScoreDTO};
4
5/// Represents the current state of a player for API clients.
6#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
7pub struct PlayerStateDTO {
8    /// The card the player cut for the deal, if it exists.
9    /// This is only of relevance in the cut_for_deal phase.
10    pub cut: Option<CardDTO>,
11
12    /// The cards currently in the player's hand. These will initially be face
13    /// down if the state represents the opponent.
14    pub hand: Vec<CardDTO>,
15
16    /// The player's current score.
17    pub score: ScoreDTO,
18}