22 lines
374 B
Swift
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]
|
|
}
|
|
|
|
}
|