M client/src/api/game/mod.rs => client/src/api/game/mod.rs +4 -0
@@ 58,6 58,10 @@ pub enum Command {
ChangePlayerState {
state: PlayerState,
},
+ RollForCurrency {
+ min: usize,
+ max: usize,
+ },
}
#[derive(Deserialize, Serialize, Clone, PartialEq)]
M client/src/game_status/parser.rs => client/src/game_status/parser.rs +3 -0
@@ 194,6 194,9 @@ fn parse_action(action: &Action, game: &Game, game_status: &mut GameStatus) {
Command::ChangePlayerState { state } => {
target.state = *state;
}
+ Command::RollForCurrency { min, max } => {
+ target.currency += Rng::with_seed(action.seed.parse::<u64>().unwrap()).usize(min..=max);
+ }
#[allow(unreachable_patterns)]
_ => todo!(),
}