Play cards, select game, player actions
This commit is contained in:
@ -26,7 +26,7 @@ extension CardOrder {
|
||||
|
||||
static func highCardIndex(cards: [Card]) -> Int {
|
||||
let high: Card
|
||||
if isTrump(cards[0]) {
|
||||
if hasTrump(in: cards) {
|
||||
high = sort(cards).first!
|
||||
} else {
|
||||
let suit = cards.first!.suit
|
||||
@ -66,4 +66,8 @@ extension CardOrder {
|
||||
static func cards(with suit: Card.Suit, in cards: [Card]) -> [Card] {
|
||||
cards.filter { !isTrump($0) && $0.suit == suit }
|
||||
}
|
||||
|
||||
static func hasCardToCall(_ suit: Card.Suit, in cards: [Card]) -> Bool {
|
||||
cards.contains { $0.symbol != .ass && $0.suit == suit && !isTrump($0) }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user