Skip to main content

api/dto/
phase.rs

1use serde::{Deserialize, Serialize};
2
3/// Represents the current phase of a game for API clients.
4///
5/// This DTO maps the server-side game phases to a client-friendly representation.
6#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
7pub enum PhaseDTO {
8    /// Default phase: the game is in the lobby, waiting for players.
9    #[default]
10    InLobby,
11
12    /// The phase where players are cutting the deck to determine the dealer.
13    CuttingForDeal,
14
15    /// The phase where players discard cards to the crib.
16    Discarding,
17
18    /// The phase where players take turns playing cards.
19    Playing,
20
21    /// The phase where the pone’s hand is scored.
22    ScoringPone,
23
24    /// The phase where the dealer’s hand is scored.
25    ScoringDealer,
26
27    /// The phase where the crib is scored.
28    ScoringCrib,
29
30    /// The game has finished and a winner has been determined.
31    Finished,
32}