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

34 lines
618 B
Swift
Raw Normal View History

2021-11-27 11:59:13 +01:00
import Foundation
2021-12-01 22:49:54 +01:00
struct TableInfo: ClientMessage {
static let type: ClientMessageType = .tableInfo
2021-11-27 11:59:13 +01:00
let id: String
let name: String
2021-12-01 22:49:54 +01:00
let players: [PlayerState]
let tableIsFull: Bool
2021-11-30 11:29:41 +01:00
2021-12-01 22:49:54 +01:00
struct PlayerState: Codable, Equatable {
let name: PlayerName
let connected: Bool
init(name: PlayerName, connected: Bool) {
self.name = name
self.connected = connected
}
}
2021-11-27 11:59:13 +01:00
}
extension TableInfo: Comparable {
static func < (lhs: TableInfo, rhs: TableInfo) -> Bool {
lhs.name < rhs.name
}
}