draw fixes and client side showing

This commit is contained in:
ntr
2019-10-27 14:12:38 +11:00
parent 6b6726f3a6
commit 343731e7e8
3 changed files with 19 additions and 23 deletions
+1 -18
View File
@@ -335,24 +335,7 @@ impl Instance {
}
fn finish_condition(&mut self) -> bool {
// tennis
for player in self.players.iter() {
if player.score == Score::Win {
self.winner = Some(player.id);
return true;
}
}
// Game defaults to lose otherwise
if self.rounds.len() < 4 {
return false;
}
// both players afk
if self.players.iter().all(|p| p.score == Score::Zero) {
return true;
}
return false;
self.players.iter().any(|p| p.score == Score::Win)
}
pub fn finish(&mut self) -> &mut Instance {