Can notify a player that the server is waiting for opponent play configuration

This commit is contained in:
2022-10-16 18:42:18 +02:00
parent e97f4b593a
commit e0132b68ed
3 changed files with 11 additions and 0 deletions

View File

@@ -22,6 +22,8 @@ pub trait Player {
fn rejected_boats_layout(&self, errors: Vec<&'static str>);
fn waiting_for_opponent_boats_layout(&self);
fn notify_other_player_ready(&self);
fn notify_game_starting(&self);
@@ -294,6 +296,8 @@ impl Handler<SetBoatsLayout> for Game {
if self.map_0.is_some() && self.map_1.is_some() {
self.players.iter().for_each(|p| p.notify_game_starting());
self.start_fire_exchanges();
} else {
self.players[player_index].waiting_for_opponent_boats_layout();
}
}
}