This optimisation removes redundant queries when looking for cards by specificed Art Preference.
getCardsFromSet has been worked-around, avoiding querying for potential candidates already in memory.
A preliminary benchmark/tests is implemented too.
There was a FIXME/TODO comment I just have found out relating to putCard implementation being inefficient.
I've re-used the new-methods implemented for lazyCardLoading to improve existing implementation.
Also, now all the PaperCard constructors won't miss collectorNumber and ArtistNames as gathered from CardInSet in CardEdition - YAY
Various optimisation to the PaperCard implementation:
- removed once and for all retrieveCollectorNumber method - we're now safe and sound that all PaperCard instances will have a collector Number matched.
- That is also made sure by removing all the many (legacy) class constructors. Only left two - with correct parameter passing!
- finally, collectorNumberSortingKey is created onces, and saved - as this won't change (for better performance)
DeckRecognizer is **the** core of the new Deck Import functionalities.
DeckRecognizer has been extended with more flexible, and alternative reg/exp for better card recognition, as well as Deck sections, card types, and deck name.
When retrieving cards from the db, the recogniser will also incorporate validation to check against illegal (from set) or banned cards considering current game/deck format.
The new set of regexp guarantee support for several M:TG deck format, including deckstats.net; tappedout; mtg-arena; mtgo
The new controller has been extended with new attributes to enable the validation to cards recognised from card list performed by DeckRecognizer.
in particular, the controller will keep track of current game format (i.e. allowedSetCodes), as well as current deck format.
Lastly, it extends support for import/replace deck
The loadDeck overloading support passing in a boolean flag to check whether current deck (if any) should be erased or not.
This will be useful when importing cards with deck importer without clearing current deck.
First round of improvements to deck import now including the current game type in the title - and so keep track of current deck format.
This will be particularly relevant for the improved DeckRecognizer which incorporates a new validation mechanism for on-the-fly card validation.
Now Deck Importer also include a very thorough set of instructions as welcome message (still WIP - to be updated and refined!)
Last but not least, there is automatic option to Import cards, or to Replace current deck (if any)
Each section requiring Validation, now can incorporate a method for sanity check. This will be useful when the deck importer will import cards that are placed in the wrong section in the list.
CardRequest now include a compose (parameter) alternative to just create a CardRequest by name, and/or a boolean flag.
Other changes include actual implementation of the new API methods (see prev. commit)
GetCardFromEditions (series of) methods now support to specify
a Predicate to filter the set of available candidates when gathering all the same card prints (by name).
For this reason, a new Predicate (isLegal) has been added to include limitations (filtering) based on set codes.
getAllCards method now include the possibility to provide a predicate
as a filter.