31 lines
510 B
Swift
31 lines
510 B
Swift
import Foundation
|
|
import WebSocketKit
|
|
|
|
final class PlayingPlayer: AbstractPlayer {
|
|
|
|
var playedCard: Card? = nil
|
|
|
|
var cards: [PlayableCard]
|
|
|
|
var leadsGame = false
|
|
|
|
var canStillRaise = true
|
|
|
|
init(player: BiddingPlayer) {
|
|
self.cards = player.cards
|
|
super.init(player: player)
|
|
}
|
|
}
|
|
|
|
extension PlayingPlayer: Player {
|
|
|
|
|
|
var actions: [PlayerAction] {
|
|
guard canStillRaise, !leadsGame else {
|
|
return []
|
|
}
|
|
return [.doubleDuringGame]
|
|
}
|
|
|
|
}
|