use crate::human_player_ws::ServerMessage; /// Make sure player can not replay after successful hit pub fn check_no_replay_on_hit(msg: &mut ServerMessage) { if let ServerMessage::OpponentMustFire { status } | ServerMessage::RequestFire { status } = msg { let diff = status.opponent_map.number_of_fires() as i32 - status.your_map.number_of_fires() as i32; assert!(diff <= 1); } }