Schafkopf-Server/Sources/App/Infos/TableInfo.swift

48 lines
828 B
Swift
Raw Normal View History

2021-11-27 11:59:13 +01:00
import Foundation
2021-12-03 18:03:29 +01:00
struct TableInfo: Codable {
2021-12-01 22:49:54 +01:00
2021-11-27 11:59:13 +01:00
let id: String
let name: String
2021-12-03 18:03:29 +01:00
var player: PlayerInfo = .init(name: "")
2021-12-03 18:03:29 +01:00
var playerLeft: PlayerInfo? = nil
2021-12-03 18:03:29 +01:00
var playerAcross: PlayerInfo? = nil
2021-12-03 18:03:29 +01:00
var playerRight: PlayerInfo? = nil
var playableGames: [GameId] = []
/// The cards in the hand of the player
var cards: [CardInfo] = []
/// The action the player can perform
var actions: [ActionId] = []
var playerSelectsGame = false
var game: GameId? = nil
2021-12-21 09:53:42 +01:00
2021-12-21 11:16:54 +01:00
var summary: GameSummary?
init(id: TableId, name: TableName) {
self.id = id
self.name = name
2021-12-01 22:49:54 +01:00
}
2021-11-27 11:59:13 +01:00
}
2021-12-03 18:03:29 +01:00
extension TableInfo {
}
2021-11-27 11:59:13 +01:00
extension TableInfo: Comparable {
static func < (lhs: TableInfo, rhs: TableInfo) -> Bool {
lhs.name < rhs.name
}
}