Schafkopf-Server/Sources/App/Model/Players/DealingPlayer.swift

30 lines
570 B
Swift
Raw Normal View History

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