Schafkopf-Server/Sources/App/Model/Players/AbstractPlayer.swift

27 lines
485 B
Swift
Raw Normal View History

import Foundation
import WebSocketKit
class AbstractPlayer {
let name: PlayerName
var socket: WebSocket?
init(name: PlayerName, socket: WebSocket? = nil) {
self.name = name
self.socket = socket
}
init(player: Player) {
self.name = player.name
self.socket = player.socket
}
}
extension AbstractPlayer: Equatable {
static func == (lhs: AbstractPlayer, rhs: AbstractPlayer) -> Bool {
lhs.name == rhs.name
}
}