-
Notifications
You must be signed in to change notification settings - Fork 3
Adding WatchOS availability & decoding conformance to Card #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nsluke
wants to merge
13
commits into
JacobHearst:main
Choose a base branch
from
nsluke:luke/watchos
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
855446c
watchos
nsluke 2460cb7
Update Card.swift
nsluke a3d3cdb
Update Card.swift
nsluke b3fdc89
Update Card.swift
nsluke 328b86c
Update Card.swift
nsluke b1be688
Update Card.swift
nsluke 4d0c612
Update Card.swift
nsluke b606e22
Update Card+Face.swift
nsluke d6f66d4
Update Card.swift
nsluke 767ec9f
Update Card.swift
nsluke 1b40366
Getting things working
nsluke e161bad
Update Card+Face.swift
nsluke d54e7e8
Merge branch 'main' into luke/watchos
nsluke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,7 +33,7 @@ public struct Card: Codable, Identifiable, Hashable, Sendable { | |
| /// The language that this specific printing was printed in | ||
| public var lang: String | ||
| /// A link to where you can begin paginating all re/prints for this card on Scryfall’s API. | ||
| public var printsSearchUri: String | ||
| public var printsSearchUri: String? | ||
| /// A link to this card’s rulings list on Scryfall’s API. | ||
| public var rulingsUri: String | ||
| /// A link to this card’s permapage on Scryfall’s website. | ||
|
|
@@ -100,6 +100,8 @@ public struct Card: Codable, Identifiable, Hashable, Sendable { | |
| // MARK: Print fields | ||
| /// The name of the artist who illustrated this card | ||
| public var artist: String? | ||
| /// An array of IDs that map to the artists who illustrated the card | ||
| public var artistIds: [String]? | ||
| /// True if this card was printed in booster packs | ||
| public var booster: Bool | ||
| /// The color of this card's border | ||
|
|
@@ -127,6 +129,8 @@ public struct Card: Codable, Identifiable, Hashable, Sendable { | |
| public var frame: Frame | ||
| /// True if this card's art is larger than normal | ||
| public var fullArt: Bool | ||
| /// A description of what security stamp the card has - for Unfinity cards, will be "acorn", for normal rares, "oval" | ||
| public var securityStamp: SecurityStamp? | ||
| /// An array of the games this card has been released in | ||
| public var games: [Game] | ||
| /// True if Scryfall has a high-res image of this card | ||
|
|
@@ -156,7 +160,7 @@ public struct Card: Codable, Identifiable, Hashable, Sendable { | |
| /// A dictionary of links to other MTG resources | ||
| public var relatedUris: [String: String] | ||
| /// This card's release date | ||
| public var releasedAt: String | ||
| public var releasedAt: String? | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Scryfall's API docs don't list this as an optional, have you seen cards where this property is nil? |
||
| /// True if this card has been printed before | ||
| public var reprint: Bool | ||
| /// Link to this card's set on Scryfall | ||
|
|
@@ -169,6 +173,8 @@ public struct Card: Codable, Identifiable, Hashable, Sendable { | |
| public var setType: MTGSet.`Type` | ||
| /// A link to this card's set object on the Scryfall API | ||
| public var setUri: String | ||
| /// A unique ID that identifies what set the card came from. | ||
| public var setId: String | ||
| /// This card's set code | ||
| public var set: String | ||
| /// True if this was a story spotlight card | ||
|
|
@@ -196,7 +202,7 @@ public struct Card: Codable, Identifiable, Hashable, Sendable { | |
| id: UUID, | ||
| oracleId: String, | ||
| lang: String, | ||
| printsSearchUri: String, | ||
| printsSearchUri: String? = nil, | ||
| rulingsUri: String, | ||
| scryfallUri: String, | ||
| uri: String, | ||
|
|
@@ -223,6 +229,7 @@ public struct Card: Codable, Identifiable, Hashable, Sendable { | |
| toughness: String? = nil, | ||
| typeLine: String? = nil, | ||
| artist: String? = nil, | ||
| artistIds: [String]? = nil, | ||
| booster: Bool, | ||
| borderColor: BorderColor, | ||
| cardBackId: UUID? = nil, | ||
|
|
@@ -235,6 +242,7 @@ public struct Card: Codable, Identifiable, Hashable, Sendable { | |
| frameEffects: [FrameEffect]? = nil, | ||
| frame: Frame, | ||
| fullArt: Bool, | ||
| securityStamp: SecurityStamp? = nil, | ||
| games: [Game], | ||
| highresImage: Bool, | ||
| illustrationId: UUID? = nil, | ||
|
|
@@ -249,13 +257,14 @@ public struct Card: Codable, Identifiable, Hashable, Sendable { | |
| purchaseUris: [String: String]? = nil, | ||
| rarity: Card.Rarity, | ||
| relatedUris: [String: String], | ||
| releasedAt: String, | ||
| releasedAt: String? = nil, | ||
| reprint: Bool, | ||
| scryfallSetUri: String, | ||
| setName: String, | ||
| setSearchUri: URL, | ||
| setType: MTGSet.`Type`, | ||
| setUri: String, | ||
| setId: String, | ||
| set: String, | ||
| storySpotlight: Bool, | ||
| textless: Bool, | ||
|
|
@@ -301,6 +310,7 @@ public struct Card: Codable, Identifiable, Hashable, Sendable { | |
| self.toughness = toughness | ||
| self.typeLine = typeLine | ||
| self.artist = artist | ||
| self.artistIds = artistIds | ||
| self.booster = booster | ||
| self.borderColor = borderColor | ||
| self.cardBackId = cardBackId | ||
|
|
@@ -313,6 +323,7 @@ public struct Card: Codable, Identifiable, Hashable, Sendable { | |
| self.frameEffects = frameEffects | ||
| self.frame = frame | ||
| self.fullArt = fullArt | ||
| self.securityStamp = securityStamp | ||
| self.games = games | ||
| self.highresImage = highresImage | ||
| self.illustrationId = illustrationId | ||
|
|
@@ -334,6 +345,7 @@ public struct Card: Codable, Identifiable, Hashable, Sendable { | |
| self.setSearchUri = setSearchUri | ||
| self.setType = setType | ||
| self.setUri = setUri | ||
| self.setId = setId | ||
| self.set = set | ||
| self.storySpotlight = storySpotlight | ||
| self.textless = textless | ||
|
|
||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,3 +39,7 @@ public enum Format: String, CaseIterable, Sendable { | |
| public enum Currency: String, CaseIterable, Sendable { | ||
| case usd, eur, tix, usdFoil, usdEtched | ||
| } | ||
|
|
||
| public enum SecurityStamp: String, Codable, Sendable { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add a header doc for this type |
||
| case oval, triangle, acorn, circle, arena, heart | ||
| } | ||
This file contains hidden or 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
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scryfall's API docs don't list this as an optional field, have you seen cards where this property is nil?