Skip to main content

spades/
game_state.rs

1use serde::{Serialize, Deserialize};
2#[cfg(feature = "server")]
3use oasgen::OaSchema;
4
5/// Current game stage, field of `Game`. 
6/// 
7/// The `Betting` and `Trick` variants have a `usize` value between 0
8/// and 3, inclusive, that refers to the number of players that have placed bets or played cards in the trick, 
9/// respectively.
10/// 
11/// **Example:** `State::Trick(2)` means the game is in the card playing stage, and two players have played their cards.
12#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
13#[cfg_attr(feature = "server", derive(oasgen::OaSchema))]
14pub enum State {
15    NotStarted,
16    Betting(usize),
17    Trick(usize),
18    Completed,
19    Aborted,
20}