Schafkopf-Server/Sources/App/Infos/GameSummary.swift
2021-12-21 14:24:53 +01:00

30 lines
634 B
Swift

import Foundation
struct GameSummary: Codable, Equatable {
let selector: PlayerName
let coPlayers: [PlayerName]
let didWin: Bool
let game: GameId
let points: Int
let cost: Int
var text: String = ""
init(table: FinishedTable, language: SupportedLanguage) {
self.selector = table.gameSelector.name
self.coPlayers = table.coPlayers.map { $0.name }
self.game = table.game.id
self.points = table.selectorTeamPoints
self.didWin = table.selectorDidWin
self.cost = table.cost
self.text = language.gameSummarizer.init(table: table).text
}
}