35 lines
788 B
Swift
35 lines
788 B
Swift
import Foundation
|
|
|
|
final class PlayingTable: AbstractTable {
|
|
|
|
var players: [PlayingPlayer]
|
|
|
|
init(table: BiddingTable) {
|
|
self.players = table.players.map(PlayingPlayer.init)
|
|
super.init(table: table)
|
|
}
|
|
}
|
|
|
|
extension PlayingTable: Table {
|
|
|
|
var allPlayers: [Player] {
|
|
players
|
|
}
|
|
|
|
var indexOfNextActor: Int {
|
|
// TODO: Implement
|
|
return 0
|
|
}
|
|
|
|
func perform(action: PlayerAction, forPlayer: PlayerName) -> (result: PlayerActionResult, table: Table?) {
|
|
// TODO: Implement raises
|
|
return (.tableStateInvalid, nil)
|
|
}
|
|
|
|
func play(card: Card, player name: PlayerName) -> (result: PlayerActionResult, table: Table?) {
|
|
// TODO: Implement playing of cards
|
|
return (.tableStateInvalid, nil)
|
|
}
|
|
|
|
}
|