Skip to content

Store the value of unimplemented enum cases #31

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
wants to merge 2 commits into
base: main
Choose a base branch
from

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.

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
2 participants