2021-12-09 11:11:17 +01:00
|
|
|
import Foundation
|
|
|
|
import WebSocketKit
|
|
|
|
|
2021-12-20 20:18:19 +01:00
|
|
|
final class DealingPlayer: CardHoldingPlayer {
|
2021-12-09 11:11:17 +01:00
|
|
|
|
2021-12-20 20:18:19 +01:00
|
|
|
var didDecide = false
|
2021-12-18 15:08:43 +01:00
|
|
|
|
|
|
|
override var actions: [PlayerAction] {
|
2021-12-20 20:18:19 +01:00
|
|
|
didDecide ? [] : [.initialDoubleCost, .noDoubleCost]
|
2021-12-18 15:08:43 +01:00
|
|
|
}
|
|
|
|
|
2021-12-09 11:11:17 +01:00
|
|
|
init(player: WaitingPlayer) {
|
|
|
|
super.init(player: player)
|
|
|
|
}
|
|
|
|
|
2021-12-20 20:18:19 +01:00
|
|
|
override var states: [PlayerState] {
|
|
|
|
var states = super.states
|
|
|
|
if !didDecide {
|
|
|
|
states.append(.canDouble)
|
|
|
|
}
|
|
|
|
return states
|
2021-12-18 15:08:43 +01:00
|
|
|
}
|
2021-12-09 11:11:17 +01:00
|
|
|
|
2021-12-20 20:18:19 +01:00
|
|
|
override var isNextActor: Bool {
|
|
|
|
get { !didDecide }
|
2021-12-18 15:08:43 +01:00
|
|
|
set { }
|
2021-12-09 11:11:17 +01:00
|
|
|
}
|
2021-12-18 15:08:43 +01:00
|
|
|
|
2021-12-09 11:11:17 +01:00
|
|
|
}
|