@@ 13,7 13,6 @@ use fastrand::Rng;
use crate::{
api::game::{Action, Command, Game},
game_status::SupplyPile,
- seed_gen,
};
use super::{GameStatus, PlayerState, PlayerStatus};
@@ 88,6 87,12 @@ pub fn parse(game: &Game) -> Result<GameStatus, ()> {
Ok(game_status)
}
+macro_rules! current_seed {
+ ($action:ident) => {
+ $action.seed.parse::<u64>().unwrap()
+ };
+}
+
fn parse_action(action: &Action, game: &Game, game_status: &mut GameStatus) {
// invoker: the one who invoked the action
// target: the one who the action affects, may also be the invoker, e.g. draw
@@ 165,7 170,7 @@ fn parse_action(action: &Action, game: &Game, game_status: &mut GameStatus) {
&action.invoker,
&action.target,
&Command::StartTurn {},
- seed_gen!(),
+ current_seed!(action),
);
game_status
.actions
@@ 186,7 191,7 @@ fn parse_action(action: &Action, game: &Game, game_status: &mut GameStatus) {
&action.target,
&action.target,
&Command::Draw { amount: 4 },
- seed_gen!(),
+ current_seed!(action),
);
game_status
.actions