Schafkopf-Server/Sources/App/Infos/TableInfo.swift
2021-12-01 22:49:54 +01:00

34 lines
618 B
Swift

import Foundation
struct TableInfo: ClientMessage {
static let type: ClientMessageType = .tableInfo
let id: String
let name: String
let players: [PlayerState]
let tableIsFull: Bool
struct PlayerState: Codable, Equatable {
let name: PlayerName
let connected: Bool
init(name: PlayerName, connected: Bool) {
self.name = name
self.connected = connected
}
}
}
extension TableInfo: Comparable {
static func < (lhs: TableInfo, rhs: TableInfo) -> Bool {
lhs.name < rhs.name
}
}