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

17 lines
322 B
Swift

import Foundation
typealias Trick = [Card]
extension Trick {
func winnerIndex(forGameType type: GameType) -> Int {
let highCard = sorted(cardOrder: type.sortingType).first!
return firstIndex(of: highCard)!
}
var points: Int {
map { $0.points }
.reduce(0, +)
}
}