Schafkopf-Server/Sources/App/Model/Tables/BiddingTable.swift

52 lines
1.2 KiB
Swift
Raw Normal View History

import Foundation
final class BiddingTable: AbstractTable {
var players: [BiddingPlayer]
var hasSelectedGame: Bool {
// TODO: Implement
false
}
init(table: DealingTable) {
self.players = table.players.map {
BiddingPlayer(player: $0, cards: [])
}
super.init(table: table)
}
func select(game: GameType, player: PlayerName) -> (result: PlayerActionResult, table: Table?) {
// TODO: Implement
return (.tableStateInvalid, nil)
}
func makePlayingTable() -> PlayingTable {
// TODO: Implement
fatalError()
}
}
extension BiddingTable: Table {
var allPlayers: [Player] {
players
}
var indexOfNextActor: Int {
// TODO: Implement
return 0
}
func perform(action: PlayerAction, forPlayer: PlayerName) -> (result: PlayerActionResult, table: Table?) {
// TODO: Implement bidding actions
return (.tableStateInvalid, nil)
}
func play(card: Card, player name: PlayerName) -> (result: PlayerActionResult, table: Table?) {
// TODO: Implement for wedding
return (.tableStateInvalid, nil)
}
}