Schafkopf-Server/Sources/App/Model/Players/FinishedPlayer.swift
2021-12-18 15:08:43 +01:00

22 lines
374 B
Swift

import Foundation
final class FinishedPlayer: Player {
let tricks: [Trick]
init(player: PlayingPlayer) {
self.tricks = player.wonTricks
super.init(player: player)
}
override var points: Int? {
get { tricks.map { $0.points }.reduce(0, +) }
set { }
}
override var actions: [PlayerAction] {
[.deal]
}
}