Commit Graph

2391 Commits

Author SHA1 Message Date
leriomaggio
43196e7c74 FIX a bug which caused the deck catalog not to update after saving the deck when current game type was not constructed!
This commit FIX #1961

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-07 10:43:22 +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
dabb40714e Updated translations and added new DeckStats classes to automate stats report generation with less duplications.
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-07 00:24:35 +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
151c6d3ec9 Removed displaying comment tokens, and unsued translation labels + impros to UI
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-06 12:08:06 +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
544b7af746 Fixed Typo in Deck Importer Win title
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-06 02:06:42 +01:00
leriomaggio
59e1203b0c Completely redesigned DeckImport with new panel for statistics and full support for i18n 2021-09-06 01:45:17 +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
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
e50ce6c7b9 Added new testcase to test whether lowercase set code are also accepted 2021-09-02 17:37:58 +01:00
leriomaggio
4576f7be6f Merge remote-tracking branch 'upstream/master' into deck-importer-decks-file-format 2021-08-31 08:49:41 +01:00
Michael Kamensky
9996bef604 Merge branch 'patch-carddb-performance' into 'master'
Code to cover cases for Randomly generated Deck (from Archetypes)

See merge request core-developers/forge!5268
2021-08-30 08:15:21 +00:00
Anthony Calosa
eb0a6d47b1 updateTest 2021-08-29 21:19:30 +08:00
leriomaggio
37283634b6 removed one line at the end of the file. 2021-08-29 07:58:59 +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
8d35f747c0 Restored original implementation (but still using iterator) 2021-08-28 20:47:03 +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
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
cb82fc2f4b Removed unused imports 2021-08-27 20:56:43 +01:00
leriomaggio
b413b777bf Few impros for performance in itempool countAll
This implementation leverages on iterables.filter to filter all keys matching the input condition, which will be iterated for counting.
2021-08-27 20:05:12 +01:00
leriomaggio
8f9dfea099 FIX card hover switch for Split and Modal cards in Card Catalog (and removed unused preference settings)
This commit FIXES a bug in card catalog which did not allow to switch the view (on hover) on cards with backface that have more than one instance!

The implementation has been simplified, also removing an unused attr!
The corresponding related Preference in settings has been also simplified to two values (being the other not even used anywhere in the game).
Therefore, now in game settings it will be possible to choose between "NEVER" switch card states, and "SWITCH on HOVER".
The default value in Constant has been updated accordingly!
2021-08-27 17:38:20 +01:00
leriomaggio
e92871a3c7 Replacing all calls to ImageUtil.hasBackFacePicture to corresponding new methods in PaperCard class (hasBackFace)
The ImageUtil.hasBackFacePicture has been removed completely as not being in use anymore after the refactoring.
2021-08-27 17:30:32 +01:00
leriomaggio
68fc6b0fd6 Replacing all calls to ImageUtil.getImageKey to corresponding new methods in PaperCard class 2021-08-27 17:24:11 +01:00
leriomaggio
fb3db3d83a removed unused import 2021-08-26 08:05:53 +01:00
leriomaggio
26ec34e019 Updated tests and capped artIndex to be two digits! 2021-08-26 07:23:09 +01:00
leriomaggio
18a537bb5e Merge remote-tracking branch 'upstream/master' into patch-carddb-performance 2021-08-26 03:03:25 +01:00
leriomaggio
c2ff9cf3c9 Re-using default ImageKeyFromSet from PaperCard instance
(This sort of things should be looked for, and optimised!)
2021-08-26 02:50:11 +01:00
leriomaggio
3acf7384e3 FIXED Sneaky bug that capped art index in DB requests to one digit!
(Added tests in cardDb and CardRequest to cover the case!)
2021-08-26 02:47:35 +01:00
leriomaggio
fed48e01c2 Pushed even further on improvements, making it run even faster than legacy
The huge improvement is due to a re-use of a getAllCards(Name, Predicate) method I started implementing into another branch for DeckImporter - re-using this method internally resolves a **lot** of duplicated iterations, and checks, which made the whole method to run even faster than the original legacy implementation!

An extra test method has been added to verify the corner case of querying for a card from editions with a very high (and weird) artIndex (like a land) - making sure that exact card is finally returned!
2021-08-25 21:03:15 +01:00
leriomaggio
bccf6e0a27 new method with tests to get all cards with a filter predicate.
New method in Interface API to get all cards in a given setCode.
This has changed the implementation of getArtCount avoiding to iterate over all the possible card prints.
2021-08-25 19:39:54 +01:00
leriomaggio
02a241de12 worst case benchmark forcing all candidates with no image! 2021-08-25 19:03:38 +01:00
leriomaggio
7b70a34da0 further optimisation by using iterator rather than forloop with if-clauses 2021-08-25 18:44:59 +01:00
leriomaggio
eff9bc4d89 typo - has to return true not false! 2021-08-25 18:31:26 +01:00
leriomaggio
841c98dc12 First round of optimisation to CardDb
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.
2021-08-25 18:15:28 +01:00
leriomaggio
637aadc188 Forcing ImageKeys.hasImage to true in Mock objects!
The alternative case is covered by another specific testcase
2021-08-25 18:13:39 +01:00
Bug Hunter
dddacd5215 Fix Cascade from opponents zone 2021-08-25 17:07:11 +00:00
leriomaggio
f45f9f6c04 Updated Foil of PaperCard - re-using getFoiled method instead of useless removed constructor. 2021-08-25 12:23:00 +01:00
leriomaggio
0db01499b3 Returning correct foiled card (no code reps) 2021-08-25 12:19:19 +01:00
leriomaggio
5608b110f8 Merge remote-tracking branch 'upstream/master' into deck-importer-decks-file-format 2021-08-25 08:44:50 +01:00
leriomaggio
697cbcca18 Updated constructor invocation for DeckImport 2021-08-22 23:59:29 +01:00
leriomaggio
e220d2157a Extended loadDeck method to support the non-complete replacement of underline model
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.
2021-08-22 23:56:02 +01:00
leriomaggio
a6b590df61 New version of the Deck Import with support for new tokens, and more
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)
2021-08-22 23:53:41 +01:00
leriomaggio
0b9a0f41cd Added method to make current game type accessible 2021-08-22 23:49:47 +01:00
leriomaggio
f541199cca New test cases for new methods + a few tests to check predicates and get cards by name 2021-08-22 23:25:19 +01:00
TRT
bc1a91186f Card Renderer: do not display hidden cards 2021-08-22 21:14:21 +02:00
Anthony Calosa
b9205b4b1e update textbox tint 2021-08-21 14:20:47 +08:00
Anthony Calosa
d62a6333a3 Update land watermarks 2021-08-20 19:11:18 +08:00