Skip to content

Conversation

@JacobHearst
Copy link
Owner

Closes #28

@JacobHearst JacobHearst changed the title Unknown assoc value Store the value of unimplemented enum cases Feb 10, 2025
@JacobHearst
Copy link
Owner Author

Waiting for #30 to merge


/// All known Magic: the Gathering frame effects
public static let allCases: [Card.FrameEffect] = [
.legendary, .miracle, .nyxtouched, .draft, .devoid, .tombstone, .colorshifted, .inverted, .sunmoondfc, .compasslanddfc, .originpwdfc, .mooneldrazidfc, .waxingandwaningmoondfc, .showcase, .extendedart, .companion, .etched, .snow, .lesson, .convertdfc, .fandfc, .battle, .gravestone, .fullart, .vehicle, .borderless, .extended, .spree, .textless, .enchantment,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we also take the opportunity to make these cases camelCase to align with all the other enums we have?

case .lesson: Card.FrameEffect.allCases.contains(.lesson)
case .convertdfc: Card.FrameEffect.allCases.contains(.convertdfc)
case .fandfc: Card.FrameEffect.allCases.contains(.fandfc)
case .battle: Card.FrameEffect.allCases.contains(.battle)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand this test correctly, I think only .battle will be tested?, might want to use fall through to make sure all cases are covered.

@missingems
Copy link
Contributor

It has been awhile, shall we get this merged

@seansfkelley
Copy link

Just found your library and love it, but strict enforcement of the enumerations is unfortunate. This is a great solution and would love to see it. Anything I can do to help it get over the line?

A case that I don't believe is handled in this PR is the eternal set type, which currently causes an exception: https://scryfall.com/search?as=grid&extras=true&lang=any&order=name&q=st%3Aeternal&unique=cards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add raw value to unknown enum cases

4 participants