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

@ -1,6 +1,6 @@
import Foundation
struct GameStatistics: Codable, Equatable {
struct GameSummary: Codable, Equatable {
let leader: PlayerName
@ -27,6 +27,7 @@ struct GameStatistics: Codable, Equatable {
self.didWin = table.winners.contains(player: leader.name)
self.cost = table.game.basicCost
// TODO: Calculate cost correctly
self.text = language.gameSummarizer.init(game: self).text
}
}

View File

@ -26,7 +26,7 @@ struct TableInfo: Codable {
var game: GameId? = nil
var gameStats: GameStatistics?
var summary: GameSummary?
init(id: TableId, name: TableName) {
self.id = id