Last active
February 16, 2022 12:25
-
-
Save ChrisMash/ef82578b7191a5b50df23d47af7b19a5 to your computer and use it in GitHub Desktop.
Snapshot of models from https://github.com/ChrisMash/SwiftUI-Playing-Cards for my blog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A representation of a playing card | |
struct Card: Identifiable, Equatable { | |
let id = UUID() | |
let number: Int | |
} | |
// A representation of a player's hand of cards | |
class Hand: ObservableObject, Identifiable { | |
let id = UUID() | |
@Published var cards = [Card]() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment