Also, the CardArtPreference Enum now includes a new methods that allows seamless recognition (and instantiation) of corresponding enum value from Forge Preference - also with backward compatibility.
The revised implementation of `attemptToLoadCard` method now also takes into consideration any setcode that may be present into request info.
This is to reduce db lookup operation and returning a card from a very specific set.
Setting the value of card art preference from string now is more reliable, and it falls back automatically to the default
(Latest Art All editions).
This is to allow setting the enum value from Forge Preference Labels.
The new name, i.e. OldArtExcludedPromoAndOnlineEditions is more self-explanatory - a bit long though.
Won't exclude that I will come back at namings after having now worked on CardEdition.Type revision
The new name IMHO is easier and more appropriate as a category name.
This would be a mismatch with Scryfall Nomenclature, but Forge contains already mismatch (e.g. REPRINT) so not a big deal.
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.