- Clear image cache if necessary (prevent clearing if the downloaded data is not image)
- Cache missing cards (prevent finding missing cards unless the user has fetched/downloads an image)
- Clear preselected options for New Gauntlet Match (easier to filter decks for Gauntlet)
This change relies on the robust cardDb methods to retrieve a card also under the circumstances of a filter in place.
This change has been introduced as this is going to be leveraged by Card Art optimisation applied to DeckList in DeckImport.
This commit adds in a new piece of information to Token in DeckRecognizer to mark whether original card request included or not a set code.
This flag will be only used by actual CardToken and will be leveraged later on by "smart card optimisation option" to be added to DeckImport on desktop too.
Majority of tests in DeckRecognizerTest have been updated to cross-check that no bug has been unintentionally introduced.
This MR brings a quick FIX to `validateDeferredSections` method in Deck which erroneously considered entries in filtered Card Pool as for the valid deck entries, instead of the original one.
Incidentally this affected only decks with no specified edition, imposing one given by card Db query using default Card Art Preference.
In other word, no card with NO edition was found and smart card art was never triggered.
This now won't be the case!
Another quick fix in `getAllCardNamesWithNoSpecifiedEdition` to skip all sections that are not MAIN | SIDE | Commander for which card art harmonisation is necessary.
.Dec files have collector nr//art-index as separated by a Pipe.
RegExps with collector numbers have been extended to further support decks in this format (with simply copy & paste the listing).
Tests updated/added to verify the new regexp & behaviour.
DeckImport now avoids including non-deck and metadata info in decklist as UnknownText, whilst any line that looks like a card request (i.e. includes a card quantity in the beginning) is interpreted as Unknown card.
This seems a good compromise with showing typo and any mispelling in card list whilst avoiding flooding decklist with unnecessary info.
This commit includes a substantial change//integration into main body of DeckRecognizer API.
First off, the types of tokens emitted by recognised as now increased, leaving place to newly specialised WARNING messages, as well as tokens for cards in invalid set or sections. Moreover, a new token for UNSUPPORTED_DECK_SECTION has been introduced, which works in pair with the new extra addition of allowed Deck sections.
This new list of allowed sections is also used whenever a new DeckSection token is created (constructor) so that if the section is not currently supported, an UNSUPPORTED_DECK_SECTION token is emitted instead.
Similarly, the card recognition step has been updated so that now deck validation mechanism has been integrated at the token level. In other words, everytime each card token is now matched to the most correct section, regardless of what's been specified in card list.
Last but not least, DeckRecognizer now includes the method to parse the whole card list (and not just a single line) to better encapsulate all the logics.
Added control to include Banned and Restricted cards, as well as a newly regExp to specify Mana colour tokens using MANA symbols placeholders (e.g. {G} for green).
Tests for new features have been added and internal documentation improved, and old ones updated with new tokens and APIs.
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
Previous implementation was lacking to check for commander section, plus re-used the code of validators. This one is a refined and refactored implementation.
Note: as default, the method will always return Main, as there is no possibility, in general, to say whether Sideboard should be preferred instead - without any other knowledge about the deck.
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
All card tokens (those having an instance of PaperCard set) now share the same message with no code duplication.
The message has been also update - and so corresponding tests - to include set code in square brackets, and collector number (identified by sharp symbol).
This change will also simplify token formatting in Deck import.
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>