import Foundation

final class FinishedPlayer: Player {

    let points: Int

    let leadsGame: Bool

    let playedCard: Card

    let selectedGame: Bool

    init(player: PlayingPlayer) {
        self.points = player.wonTricks.map { $0.points }.reduce(0, +)
        self.leadsGame = player.leadsGame
        self.playedCard = player.playedCard!
        self.selectedGame = player.selectsGame
        super.init(player: player)
    }

    override var actions: [PlayerAction] {
        [.deal]
    }

    override var states: [PlayerState] {
        super.states + [] // TODO: Finish
    }

    override var info: PlayerInfo {
        var result = super.info
        result.playedCard = playedCard.id
        return result
    }

}
