This new filter mirrors (and extends) the one on Sets, which also relies on the renewed buildPredicate implementatio which looks at the edition of
a DeckProxy.
Now this new implementation brings the deck set filter to finally work as expected.
In particular, instead of checking that all cards in Deck Pools belong to a unique edition, the predicate now leverages on the getEdition() method of DeckProxy instances, which returns the latest of the earliest
sets of cards. This function will be subject to change into a future Merge Request state.
This is the first step to finally make the DeckSetFilter working properly!
So far, the filter applies if **all** the cards in a deck matches selected specific set(s).
We will allow for customisation to simplify and correct this filter - more in the next commit.
The new CardBlockFilter extends the generic CardSetFilter by specialising the selection to set codes allowed in the corresponding Block GameFormat.
A new Label `lblBlock` has been added to language file (so far, English only)
CardManager now instantiate Quest World filters forcing a NO-REPRINT policy. The `allowReprints` option was set to true by default for card and deck catalog, resulting in just a weird and unexpected side-effect IMHO. Whenever a block is selected, no other reprints should be taken into account. That's the point of choosing a block.
The CardQuestWorldFilter has been updated with two extra constructors overload that also control the option to include or not the `allowReprints` attribute.
By default, the allowReprints attribute is true for backward compatibility.
The new constructor will be used (next commit) by CardManager when creating filters in Card Catalog.
First off, the status of the "allowReprints" checkbox is updated accordingly, when a filter is edited.
This fixes a previous bug that did not take this into account
(more on this, in the next commit msg).
Other improvements to the DialogChooseSets includes a better management of spaces, as well as dimension (width) of main windows that is now dynamically adapted to current resolution.
Also, this update fixes a bug having some panels dynamically adjusting height to fit components.
Now all the components should be correctly aligned, and spread across the panel.
This new version of the panel is completely interactive, and dynamically populated with card editions, types, and formats.
The selection of formats leads to selections of subsets of editions (and so type), updating other components accordingly.
Differently from standard JTree, this component leverages on a custom TreeCellRenderer that renders each node with a checkbox, therefore rewriting completely the selection mechanism of the JTree.
This component is currently used in the DialogChooseSets to represent card editions grouped per edition type.
In general, this component can be used elsewhere, whenever nested objects for selection should be used.
The class exposes a public API for easy interaction, as well as customised classes for nodes and nodes data, and specialised events and listeners.
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 base class will be used throughout the tests whenever Card Database (Mocks) will be required for testing.
This will be the case (for example) of tests for CardRequest, CardEdition, CardDb.