If card is matched, it disapears
This commit is contained in:
@@ -20,7 +20,11 @@ class SetGameModelView: ObservableObject {
|
||||
}
|
||||
|
||||
var cardsOnTable: Array<Card> {
|
||||
model.displayedCards
|
||||
model.displayedCards.filter(showCard)
|
||||
}
|
||||
|
||||
private func showCard(card: SetGameModelView.Card) -> Bool {
|
||||
!card.isMatched
|
||||
}
|
||||
|
||||
func newGame() {
|
||||
|
||||
@@ -78,8 +78,6 @@ struct CardView: View {
|
||||
cardShape.aspectRatio(2/3, contentMode: .fit)
|
||||
if (card.isSelected) {
|
||||
cardShape.foregroundColor(selectedGreen)
|
||||
} else if (card.isMatched) {
|
||||
cardShape.foregroundColor(colors[card.matchId])
|
||||
} else {
|
||||
cardShape.foregroundColor(.white)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user