Add game summary on client side

This commit is contained in:
Christoph Hagen
2021-12-21 11:16:54 +01:00
parent 941b25346d
commit b5cc395456
11 changed files with 46 additions and 10 deletions

View File

@ -19,7 +19,7 @@ final class DealingTable: AbstractTable<DealingPlayer> {
/// At least one player placed a bid
var hasDouble: Bool {
players.contains { $0.didDouble == true }
players.contains { $0.didDouble }
}
override func perform(action: PlayerAction, forPlayer name: PlayerName) -> (result: PlayerActionResult, table: ManageableTable?) {
@ -46,6 +46,7 @@ final class DealingTable: AbstractTable<DealingPlayer> {
return (.tableStateInvalid, nil)
}
player.didDouble = double
player.didDecide = true
guard allPlayersActed else {
return (.success, nil)
}

View File

@ -87,7 +87,7 @@ final class FinishedTable: AbstractTable<FinishedPlayer> {
override func tableInfo(forPlayerAt index: Int) -> TableInfo {
var info = super.tableInfo(forPlayerAt: index)
info.gameStats = GameStatistics(table: self, language: language)
info.summary = GameSummary(table: self, language: language)
return info
}
}