52 lines
1.2 KiB
Swift
52 lines
1.2 KiB
Swift
|
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)
|
||
|
}
|
||
|
|
||
|
}
|