DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

1d78fe11dd084ca242f79f1fc893172b69563c65 — Jonni Liljamo 1 year, 10 months ago 9b88fcf
feat(sdbclient): implement Action and GameData
1 files changed, 31 insertions(+), 0 deletions(-)

M sdbclient/src/api/game/types.rs
M sdbclient/src/api/game/types.rs => sdbclient/src/api/game/types.rs +31 -0
@@ 32,3 32,34 @@ pub struct Game {
    pub state: GameState,
    pub ended_at: String,
}

#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Action {
    pub id: String,
    pub created_at: String,
    pub updated_at: String,
    pub game_data_id: String,
    pub invoker: String,
    pub data: String,
    pub timestamp: String,
}

#[derive(Debug, Serialize_repr, Deserialize_repr, Clone, PartialEq)]
#[repr(u8)]
pub enum GameTurn {
    Host = 0,
    Guest = 1,
}

#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct GameData {
    pub id: String,
    pub created_at: String,
    pub updated_at: String,
    pub actions: Vec<Action>,
    pub turn: GameTurn,
    pub host_hand: String,
    pub host_deck: String,
    pub guest_hand: String,
    pub guest_deck: String,
}