Can notify a player that the server is waiting for opponent play configuration
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user