Import Parses Tyrannax Rex Incorrectly
Describe the bug When using the Import Feature, the importer interprets the "Rex" in "Tyrannax Rex" as a set, instead of part of its name. Adding the card via Card Catalog works normally.
To Reproduce Steps to reproduce the behavior:
- Go to Deck Editor
- Click on Import
- Input "1 Tyrannax Rex" as a card to import
- The importer displays "Tyrannax [Rex]" and of course doesn't fetch the card.
Expected behavior The importer should recognize Tyrannax Rex as the name of the card, not interpret "Rex" as a set.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: Windows
- Version 1.6.64
Additional context I'm only a amateur programmer myself and a bit of a novice, but I suspect the fact that "Rex" has three letters might be what's causing the parser to trip and think it's a set code?
This is a known issue. It's because REX is an actual set code.
@tehdiplomat can we somehow prioritize full string "Tyrannax Rex" as Cardname before checking if "Rex" could be a SetCode?
Looking at the order the DeckRecognizer does things in, a fallback might be simpler than changing the order the patterns are checked in. Maybe something similar to the one for double faced cards? https://github.com/Card-Forge/forge/blob/4b533d22a03dd57442557194f38d0f17a9db87d3/forge-core/src/main/java/forge/deck/DeckRecognizer.java#L627-L630
So if the name isn't a real card but there's a set code, see if tacking the set code onto the name makes it a real card, and if so, proceed from there?