Schafkopf-Server/Sources/App/Infos/PublicTableInfo.swift
Christoph Hagen 3db9652cad Sync push
2021-12-03 18:03:29 +01:00

28 lines
535 B
Swift

import Foundation
struct PublicTableInfo: Codable {
let id: TableId
let name: TableName
let players: [PlayerName]
let tableIsFull: Bool
init(id: TableId, name: String, players: [PlayerName]) {
self.id = id
self.name = name
self.players = players
self.tableIsFull = players.count == maximumPlayersPerTable
}
}
extension PublicTableInfo: Comparable {
static func < (lhs: PublicTableInfo, rhs: PublicTableInfo) -> Bool {
lhs.name < rhs.name
}
}