Schafkopf-Server/Sources/App/Model/Players/DealingPlayer.swift
2021-12-20 20:18:19 +01:00

30 lines
570 B
Swift

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