2021-12-18 15:08:43 +01:00
|
|
|
import Foundation
|
|
|
|
|
|
|
|
final class FinishedPlayer: Player {
|
|
|
|
|
2021-12-20 20:18:19 +01:00
|
|
|
let points: Int
|
|
|
|
|
|
|
|
let leadsGame: Bool
|
|
|
|
|
|
|
|
let playedCard: Card
|
2021-12-18 15:08:43 +01:00
|
|
|
|
2021-12-21 09:53:42 +01:00
|
|
|
let selectedGame: Bool
|
|
|
|
|
2021-12-18 15:08:43 +01:00
|
|
|
init(player: PlayingPlayer) {
|
2021-12-20 20:18:19 +01:00
|
|
|
self.points = player.wonTricks.map { $0.points }.reduce(0, +)
|
|
|
|
self.leadsGame = player.leadsGame
|
|
|
|
self.playedCard = player.playedCard!
|
2021-12-21 09:53:42 +01:00
|
|
|
self.selectedGame = player.selectsGame
|
2021-12-18 15:08:43 +01:00
|
|
|
super.init(player: player)
|
|
|
|
}
|
|
|
|
|
|
|
|
override var actions: [PlayerAction] {
|
|
|
|
[.deal]
|
|
|
|
}
|
|
|
|
|
2021-12-20 20:18:19 +01:00
|
|
|
override var states: [PlayerState] {
|
|
|
|
super.states + [] // TODO: Finish
|
|
|
|
}
|
|
|
|
|
|
|
|
override var info: PlayerInfo {
|
|
|
|
var result = super.info
|
|
|
|
result.playedCard = playedCard.id
|
|
|
|
return result
|
|
|
|
}
|
|
|
|
|
2021-12-18 15:08:43 +01:00
|
|
|
}
|