Add game summary on client side
This commit is contained in:
@ -2,7 +2,7 @@ import Foundation
|
||||
|
||||
struct EnglishGameSummarizer: GameSummarizer {
|
||||
|
||||
let game: GameStatistics
|
||||
let game: GameSummary
|
||||
|
||||
private var winText: String {
|
||||
game.didWin ? "won" : "lost"
|
||||
|
@ -2,7 +2,7 @@ import Foundation
|
||||
|
||||
protocol GameSummarizer {
|
||||
|
||||
init(game: GameStatistics)
|
||||
init(game: GameSummary)
|
||||
|
||||
var text: String { get }
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ import Foundation
|
||||
|
||||
struct GermanGameSummarizer: GameSummarizer {
|
||||
|
||||
let game: GameStatistics
|
||||
let game: GameSummary
|
||||
|
||||
var winText: String {
|
||||
game.didWin ? "gewinnt" : "verliert"
|
||||
@ -56,7 +56,7 @@ struct GermanGameSummarizer: GameSummarizer {
|
||||
}
|
||||
|
||||
var text: String {
|
||||
"\(game.leader) \(winText) \(gameText)\(coPlayerNames) mit \(game.leaderPoints) points. " +
|
||||
"\(game.leader) \(winText) \(gameText)\(coPlayerNames) mit \(game.leaderPoints) Punkten. " +
|
||||
"Das Spiel kostet \(costText)."
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user