Card Editions now includes updated Types, following the new remapping.
Moreover, a new option to CardEdition.Reader has been added (in the constructor) in order to account for custom editions.
So far this new "reading mode" accounts for type that is "forced" always to be "THIRDPARTY" so to guarantee consistent sets filtering (so far only on Mobile platform).
This new option is integrated in StaticData when instantiating the collection for CustomEditions.
This commit includes major updates to the CardDb aligned with the new ICardDatabase (refactored) API.
The implementation of the API now includes a more standardised and linear approach in (single) card retrieval which leverages on the refactored methods.
All these methods rely on the **new** and revised CardRequest object that now support a new method to compose request strings, as well as extending support to requests including the collector numbers.
This is a major update going towards the direction of integrating the collector number in Deck Importer when analysing cards lists.
All these new implementations have been thoroughly tested considering all possible conditions, foil cards, cards with multiple arts, and date filtering, and results compared with **previous** card DB implementation to be sure no behaviour was left uncovered from previous implementation.
(Please see `LegacyDb` class in `forge.card` tests for more details).
Cards in CardPool are now added also including the collector number directly. This should avoid PaperCard instances to rely on the retrieveCollectorNumber methods in PaperCard. [THIS needs to be tested yet].
Another major change to class structure regards the new renamed SetPreference to a more intuitive CardArtPreference.
This will be used to set up card art preference in the UI, as well as to guide card retrieval default behaviour.
(This option will be later included in the Desktop GUI as well).
Tests to compare the behaviour of these new options, and the old ones have been conducted, and all passed.
Also, this attribute has been moved from StaticData to CardDb as it seems more appropriate encapsulation, without any circular dependency.
A new method (not included in ICardDatabase) has been added to CardDb API (i.e. getCardFromEditions(name) ) which relies on the default Card Art preference.
Last but not least, Anthologies edition file receives an update on the TYPE (from other to reprint) to also deal with expected testings - case "Hymn To Tourach" when `LatestPrintNoPromoNoOnline` is selected.
This is an attempt to start removing all the hard-coded values
used throughout the code base whenever art index should be
invoked, by relying on a more stable approach based on
constants.
The API for Magic Card Database has been refactored so to include card look up methods as organised in three main categories:
- single card lookup based on details (name, ed code, collector number)
- card lookup from a given edition (i.e. CardEdition instance)
- card lookup based on Art Preference
Methods to retrieve collection of cards have been renamed to allow
for overloading, within a more consistent API.
Same for utility methods to retrieve cards' art index and count.
Last but not least, the old "getFoiled" method has been removed to leave space to the new method in PaperCard API.
StaticData now includes a new method, namely `getCardEdition` which looks for a CardEdition instance into editions and customeditions given an input set code.
This new method has been refactored and used throughout the new changes in Advanced Search and Filters.
- Reader has a new updated regexp to deal with non-numerical collectorNumbers
- CardInSet have been now made sortable based on CollectorNumber.
To do so, collectorNumbers are transformed accordingly to allow for natural ordering (as expected) instead of lexicographic order.
- CardEdition now return cards (CardInSet) as sorted, to allow for correct artIndex matching when creating corresponding `PaperCard` instances.
Moreover, `compareTo` of card edition has been improved to also take into account set name (in cases of same release date).
- Reader has a new updated regexp to deal with non-numerical collectorNumbers
- CardInSet have been now made sortable based on CollectorNumber.
To do so, collectorNumbers are transformed accordingly to allow for natural ordering (as expected) instead of lexicographic order.
- CardEdition now return cards (CardInSet) as sorted, to allow for correct artIndex matching when creating corresponding `PaperCard` instances.
Moreover, `compareTo` of card edition has been improved to also take into account set name (in cases of same release date).