Commit Graph

1449 Commits

Author SHA1 Message Date
leriomaggio
f8cb6141bd Further optimised cardDb method with filter using AlwaysTrue + and Chain
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-13 18:58:54 +01:00
leriomaggio
a9f1cd3c97 Merge remote-tracking branch 'upstream/master' into deck-importer-decks-file-format 2021-09-13 18:47:35 +01:00
Anthony Calosa
ac350a0bfb [Mobile] Fix card image not loading 2021-09-13 23:01:13 +08:00
leriomaggio
236fd99862 FIX cardDb tests in Maven for ImageKeys Mock configuration between subclasses 2021-09-13 10:15:32 +01:00
leriomaggio
ab0b964772 Full support to XMage format recognition with tests
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-12 18:30:59 +01:00
leriomaggio
5beb350faf Support for DeckNames as in NetDecks with brackets and hashtags
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-12 11:42:10 +01:00
leriomaggio
014783dfbe Added planes deck section to nonCardToken recognition (left out by mistake)
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-12 11:06:07 +01:00
leriomaggio
95f1d6df07 Updated Card Tokens (with test) to retain cards even if not legal.
This will be now used in DeckImporter in combination with Card Preview.

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-12 10:56:32 +01:00
leriomaggio
5400546399 Aligned with bug fixed on multipleArts with SmartCardArt
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-12 10:28:50 +01:00
Anthony Calosa
6f0ba03d24 [Mobile] Fix blinking card images while using online image fetcher
- also cache card list for faster lookup
2021-09-12 15:52:57 +08:00
leriomaggio
fb092c77a4 BUG FIX for Smart Card Art selection
This subtle bug occurred whenever the algorithm for smart card art selection wanted to add a card with multiple arts and the number of cards per art to add was not even. To avoid zeros, the cardsPerArtIndex was set at least to one, and so the rest - leading then to adding too many (extra) cards not originally present in the deck.

Thanks to @Snoops for the heads up.
2021-09-12 00:56:44 +01:00
leriomaggio
455acffeab Update to SmartCardArt accounting for any preferred art.
If there is any preferredArt, update will never be applied.
The scenario is: if card was originally without any specified edition, AND there is preferred art, that would've been returned in the first place.

Thus, if the smartCardArt optimisation is enabled, any card with the preferred art won't be updated iff edition and artIndex coincide.

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-10 18:23:36 +01:00
leriomaggio
e90b0323b7 Merge remote-tracking branch 'upstream/master' into deck-importer-decks-file-format 2021-09-10 16:10:13 +01:00
leriomaggio
ade839bec4 Removed from Deck controls on Deck Sections as now the DeckSection validation mechanism has been already integrated when loading deck.
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-10 14:27:31 +01:00
leriomaggio
27ab4c35a3 Re-add to carddb the integration with CardPreferences on Mobile version
On Mobile Forge Port (only) there is the possibility to set a preferred art for a card, from card catalog.
Once a card art is selected, it will always be returned for that specific art whenever no other specific edition is specified.
This commit adds changes to cardDb setPreferredArtMethod (API) and CardRequest.fromString to work with any preferred art (if any).

CardRequests reflects this change by adding another (private) constructor which expects to create a CardRequest from a preferredArt entry in the form of (CardName|SetCode|ArtIndex)
2021-09-10 14:09:25 +01:00
leriomaggio
9d235924ec Re-add to carddb the integration with CardPreferences on Mobile version
On Mobile Forge Port (only) there is the possibility to set a preferred art for a card, from card catalog.
Once a card art is selected, it will always be returned for that specific art.
This commit adds changes to cardDb setPreferredArtMethod (API) and CardRequest.fromString to work with any preferred art (if any).

CardRequests reflects this change by adding another (private) constructor which expects to create a CardRequest from a preferredArt entry in the form of (CardName|SetCode|ArtIndex)
2021-09-10 13:26:30 +01:00
leriomaggio
2297f34ce2 Added full support to all Deckstats deck exports + bug fix&extra tests
Now DeckRecognizer supports all the exports of decks from Deckstats.net.
This now also includes card lists grouped by Rarity, CMC, and Mana Colours.

A new set of tests have been also added to test for the new non-card token types parsing, as well as a condition with multiple constraints imposed on the deck recogniser at a time. In particular, now all the combinations of constraints (also together) have been tested, and therefore the types of token returned has been adjusted.

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-08 21:27:43 +01:00
leriomaggio
20d9dbdb57 Perf Impro to Deck Editor Loading Issue #1847
This is another extra improvement which avoids setting up card catalog in current editor whenever it is actually **not** needed.

To do so, ItemPool now implements and equal method, which reflects to equality of contained items.
This is because card pool is set up multiple times whenever the Deck Editor tab is initialised - and the operation of setting up the catalog manager is particularly expensive (let alone useless when it's already done!)

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-07 11:46:44 +01:00
leriomaggio
84763e5dbc Adding support for deck name in Forge Deck Format
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-07 00:35:08 +01:00
leriomaggio
ef1ea8e60d FIX Issue #1413
This commit includes support to the XMage format in Deck Recognizer along with corresponding new tests and updates to labels for UI

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-06 12:41:04 +01:00
leriomaggio
54193e0ac0 Added support to TappedOut Markdown format, and to TOARENA MTGGOLDFISH export.
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-06 12:07:11 +01:00
leriomaggio
60f93853c4 Revert "Replacing GetFilteredPoolWithCount with GetFilteredPool"
This reverts commit 64b72bbf89.
2021-09-06 01:56:14 +01:00
tool4EvEr
ba5ef78f31 Revert Comment out some currently unsupported cards in Commander precons 2021-09-06 01:55:42 +01:00
Anthony Calosa
9ea7772d7b add Artist & adjust crop for modern/old frames 2021-09-06 01:55:42 +01:00
leriomaggio
64b72bbf89 Replacing GetFilteredPoolWithCount with GetFilteredPool 2021-09-06 01:47:12 +01:00
leriomaggio
e56b9183b1 Renamed validator for Main and Side. 2021-09-06 01:45:51 +01:00
leriomaggio
71793fb747 Added tests for latest additions in supporting MTGGoldfish (special) format for collector numbers.
DeckRecognizer now also support the (special) format for request lines in MTGGoldfish deck exports.
In Addition, changes to reduce comparisons, and general performance in card matching.
2021-09-05 20:44:03 +01:00
Michael Kamensky
d367f8abf9 Merge branch 'master' into 'master'
[Mobile] add Artist & adjust crop for modern/old frames

See merge request core-developers/forge!5290
2021-09-04 18:46:15 +00:00
Anthony Calosa
cd47c591b3 add Artist & adjust crop for modern/old frames 2021-09-04 18:54:49 +08:00
tool4EvEr
3bf978991c Revert Comment out some currently unsupported cards in Commander precons 2021-09-04 11:33:44 +02:00
leriomaggio
83853280b6 Completely re-implemented and tested Matchers for DeckRecognizer
The new DeckRecognizer implementation comes fully tested to check the new multiple line request format supported.
The DeckRecognizer has been made very versatile for card recognition - supporting request with multiple formats - as well as for NON-CARD tokens including "Deck Name", "Deck Sections", and "Card (Core) Types".

There is also integration for constraints imposed on card matching due to
restrictions (in set) from Game Format, Deck Format (banned cards), and Date (Release Before).
In those cases, new Token Types will be returned (i.e. "IllegalCard" and "InvalidCard", respectively) that could be pretty-printed or emphasised in DeckImport.
2021-09-02 17:43:13 +01:00
leriomaggio
624dd62665 Added new method to getCard from Editions released before certain date, and filter (but using default card art preference) 2021-09-02 17:39:12 +01:00
leriomaggio
4576f7be6f Merge remote-tracking branch 'upstream/master' into deck-importer-decks-file-format 2021-08-31 08:49:41 +01:00
leriomaggio
24c31e9de9 Restored sort in CardPool using Collections to allow for Android comp. 2021-08-29 11:02:26 +01:00
leriomaggio
b1ed8565d3 FIXED typo in using iterator rather than keyset directly 2021-08-29 08:06:43 +01:00
leriomaggio
872fca65a4 Extended CardDB API (w/ Tests) adding a Predicate filter for getCardFromEditions series
The getCardFromEditions series now include new variants (also for released before/after) accepting an extra filter to be
passed used as an extra filter for returned cards!
2021-08-29 01:40:45 +01:00
leriomaggio
831b40e753 Removed unused imports! 2021-08-28 21:13:59 +01:00
leriomaggio
924c57be70 FIX typo, and renamed vars! 2021-08-28 20:58:06 +01:00
leriomaggio
eea2b754ec Added new Lookup table for sortable collector number to avoid repeated computations for the same coll numbers!
FIX typo and made map final!
2021-08-28 20:55:33 +01:00
leriomaggio
e2034ebd51 Added new Lookup table for sortable collector number to avoid repeated computations for the same coll numbers! 2021-08-28 20:48:27 +01:00
leriomaggio
a8acbf0491 Improved CountAll method implementation using Maps 2021-08-28 20:46:44 +01:00
leriomaggio
8768900cf8 FIX cardDb bug for lazy card loading when issuing a request with a non-existing set code.
Code FIX + Test
Now the implementation in CardDb will automatically try to get the card with that name from an existing edition
2021-08-28 18:29:07 +01:00
leriomaggio
a7d1e7398a FIX cardDb bug for lazy card loading when issuing a request with a non-existing set code.
Code FIX + Test
2021-08-28 17:54:53 +01:00
leriomaggio
876a00c101 Merge remote-tracking branch 'upstream/master' into deck-importer-decks-file-format 2021-08-28 17:16:24 +01:00
leriomaggio
b1c50599e9 Improvements to getFilteredPool method.
Previous implementation did not consider the amount per card included in the pool already - so the filtered pool always got 1 amount for each card passing the filter.

This should be no problem considering where this method is used. However, to make it portable to other cases, I made the implementation to report the same amount of cards in the new filtered pool.
2021-08-28 16:59:26 +01:00
leriomaggio
7613b27e6e Still scratching a little of performance impros by avoiding checking class instance.
When StatTypeFilter is used withing Deck Editor (with all PaperCard instance in ItemPool), avoiding checking instance class improves performance a bit (saving a couple of hundreds of milliseconds).

However, when this filter with also other inventory items (pack or deck), the same code as before is executed.
2021-08-28 16:47:10 +01:00
leriomaggio
42e91b60ea Code to cover cases for Randomly generated Deck (from Archetypes) not having collectorNumbers and Artist Set 2021-08-28 16:39:59 +01:00
TRT
1529ffe630 Fix ImageKeys again 2021-08-28 07:38:32 +02:00
Michael Kamensky
18ab34e3d5 Merge branch 'patch-carddb-performance' into 'master'
Card Hover FIX in Catalog + extra optimisation in performance and refactoring

See merge request core-developers/forge!5263
2021-08-28 05:05:21 +00:00
Anthony Calosa
f6341a2bc9 fix ImageKeys.java 2021-08-27 22:13:46 +00:00