DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

8e212372351f7127a2e616c5b1ded3313dee70bb — skye 1 year, 5 months ago 395ef27
feat(client): add seed to action api call, new fn
2 files changed, 23 insertions(+), 0 deletions(-)

M client/src/api/game/create_action.rs
M client/src/api/game/mod.rs
M client/src/api/game/create_action.rs => client/src/api/game/create_action.rs +2 -0
@@ 20,6 20,7 @@ struct CreateActionPost {
    invoker: String,
    target: String,
    command: Command,
    seed: u64,
}

pub fn create_action(


@@ 31,6 32,7 @@ pub fn create_action(
        invoker: action.invoker.to_string(),
        target: action.target.to_string(),
        command: action.command.clone(),
        seed: action.seed,
    });

    Ok(res.json().unwrap())

M client/src/api/game/mod.rs => client/src/api/game/mod.rs +21 -0
@@ 54,6 54,27 @@ pub struct Action {
    pub seed: u64,
}

impl Action {
    pub fn new(
        game_id: &str,
        invoker: &str,
        target: &str,
        command: &Command,
        seed: u64
    ) -> Self {
        Self {
            id: "".to_string(),
            created_at: "".to_string(),
            updated_at: "".to_string(),
            game_id: game_id.to_string(),
            invoker: invoker.to_string(),
            target: target.to_string(),
            command: command.clone(),
            seed,
        }
    }
}

#[derive(Debug, Deserialize_repr, Clone, PartialEq)]
#[repr(u8)]
pub enum GameState {