Commit Graph

1502 Commits

Author SHA1 Message Date
Anthony Calosa
cb0101fc52 [Mobile] Auto optimize card art when importing 2021-10-30 04:58:45 +08:00
leriomaggio
663ebd4120 Merge remote-tracking branch 'upstream/master' into deck-importer-decks-file-format 2021-10-28 23:20:48 +01:00
leriomaggio
40dac70ebf QuickFIX deckSection validation in Decks that inhibited the smart card art option to trigger
This MR brings a quick FIX to `validateDeferredSections` method in Deck which erroneously considered entries in filtered Card Pool as for the valid deck entries, instead of the original one.
Incidentally this affected only decks with no specified edition, imposing one given by card Db query using default Card Art Preference.
In other word, no card with NO edition was found and smart card art was never triggered.

This now won't be the case!

Another quick fix in `getAllCardNamesWithNoSpecifiedEdition` to skip all sections that are not MAIN | SIDE | Commander for which card art harmonisation is necessary.
2021-10-28 21:35:32 +01:00
tool4EvEr
1d0739d728 Fix Fury 2021-10-27 20:38:15 +02:00
leriomaggio
c31d4cbb1f Implementing (deep) deck comparison based on similarity of parts (cardPool) 2021-10-26 17:30:28 +02:00
TRT
5e050765a3 Clean up 2021-10-26 13:41:31 +02:00
tool4EvEr
fb88fcfe9c Fix deck loading not restoring foiled status 2021-10-25 23:54:08 +02:00
leriomaggio
b350a2d110 FIXED issue with race condition when updating deferredSections 2021-10-24 10:40:27 +02:00
leriomaggio
526d41bddd Added dungeon section in DeckSection matching for cards 2021-10-24 10:39:59 +02:00
leriomaggio
9f97b34a3a Recognise new Dungeon DeckSection Placeholder, and improved support to .dec files
.Dec files have collector nr//art-index as separated by a Pipe.
RegExps with collector numbers have been extended to further support decks in this format (with simply copy & paste the listing).
Tests updated/added to verify the new regexp & behaviour.
2021-10-23 21:45:04 +02:00
leriomaggio
ed19bf0a22 New Dungeon DeckSection and corresponding validator 2021-10-23 21:43:24 +02:00
leriomaggio
87439388db Improved support for Unknown cards in DeckImport
DeckImport now avoids including non-deck and metadata info in decklist as UnknownText, whilst any line that looks like a card request (i.e. includes a card quantity in the beginning) is interpreted as Unknown card.

This seems a good compromise with showing typo and any mispelling in card list whilst avoiding flooding decklist with unnecessary info.
2021-10-20 10:47:44 +02:00
leriomaggio
ca45deb935 Added patch to handle corner case with Conspiracy section as formatted in dec files. 2021-10-19 23:32:51 +02:00
TRT
0762d0877a Fix for Dewdrop Spy 2021-10-19 17:29:09 +02:00
Northmoc
80171918dd initial Friends forever 2021-10-18 07:58:01 -04:00
Michael Kamensky
1f0e7f7348 Merge branch 'vulns' into 'master'
update to fix known vulnerabilities

See merge request core-developers/forge!5576
2021-10-17 13:49:21 +00:00
Jamin W. Collins
920c5bceea upgrade to fix known vulnerabilities
* https://snyk.io/vuln/SNYK-JAVA-COMGOOGLEGUAVA-1015415
* https://snyk.io/vuln/SNYK-JAVA-COMGOOGLEGUAVA-32236

Signed-off-by: Jamin W. Collins <jamin.collins@gmail.com>
2021-10-16 20:54:11 -07:00
tool4EvEr
654e671afb Clean up 2021-10-16 23:16:32 +02:00
tool4EvEr
1a1088399e Cleanup 2021-10-16 21:34:12 +02:00
Michael Kamensky
87521416b2 Merge branch 'deck-importer-decks-file-format' into 'master'
NEW Deck Importer

See merge request core-developers/forge!5296
2021-10-16 16:47:29 +00:00
Michael Kamensky
5520cd2a67 [maven-release-plugin] prepare for next development iteration 2021-10-16 18:52:21 +03:00
Michael Kamensky
340a6b2af5 [maven-release-plugin] prepare release forge-1.6.45 2021-10-16 18:52:12 +03:00
leriomaggio
d056d2a683 Added "Special" placeholder for card rarity
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-10-15 19:40:02 +01:00
leriomaggio
30a7c6aed4 Adding support for Dual/Double-sided cards in parsing + patch for commander export from Deckstats
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-10-15 19:33:13 +01:00
leriomaggio
e91277f271 Merge remote-tracking branch 'upstream/master' into deck-importer-decks-file-format 2021-10-15 13:39:00 +01:00
leriomaggio
a012b236a5 Few changes to Deck Name and CC tokens trimmed and uppercase (resp).
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-10-15 13:11:25 +01:00
leriomaggio
44cfc76552 Added support for Foiled cards in Token Key (w. tests)
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-10-10 08:24:47 +01:00
leriomaggio
1934f27da3 Typo in documentation
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-10-09 00:17:34 +01:00
leriomaggio
9f04f0cec7 Improved Token Mana Symbol Regexp with support for two colours tokens (and symbols)
All corresponding tests have been extended, and improved to cover the new supported Mana Tokens

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-10-08 13:45:31 +01:00
Michael Kamensky
ccc423dd26 - Patch getPaperCardFromImageKey not to crash for the Commander replacement effect 2021-10-07 22:09:53 +03:00
leriomaggio
835b05e573 Added support for corner case to match correct section accounting for unsupported sections.
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-10-06 20:13:25 +01:00
leriomaggio
65001478b7 Heavy refactoring of DeckRecognizer to introduce cardList parsing, allowed sections, and revised TokenTypes
This commit includes a substantial change//integration into main body of DeckRecognizer API.
First off, the types of tokens emitted by recognised as now increased, leaving place to newly specialised WARNING messages, as well as tokens for cards in invalid set or sections. Moreover, a new token for UNSUPPORTED_DECK_SECTION has been introduced, which works in pair with the new extra addition of allowed Deck sections.
This new list of allowed sections is also used whenever a new DeckSection token is created (constructor) so that if the section is not currently supported, an UNSUPPORTED_DECK_SECTION token is emitted instead.

Similarly, the card recognition step has been updated so that now deck validation mechanism has been integrated at the token level. In other words, everytime each card token is now matched to the most correct section, regardless of what's been specified in card list.

Last but not least, DeckRecognizer now includes the method to parse the whole card list (and not just a single line) to better encapsulate all the logics.
Added control to include Banned and Restricted cards, as well as a newly regExp to specify Mana colour tokens using MANA symbols placeholders (e.g. {G} for green).

Tests for new features have been added and internal documentation improved, and old ones updated with new tokens and APIs.

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-10-06 16:43:24 +01:00
leriomaggio
08ca0bf175 Improved implementation of DeckSection Matching
Previous implementation was lacking to check for commander section, plus re-used the code of validators. This one is a refined and refactored implementation.

Note: as default, the method will always return Main, as there is no possibility, in general, to say whether Sideboard should be preferred instead - without any other knowledge about the deck.
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-10-02 07:38:17 +01:00
leriomaggio
3e3cdc6808 Remove duplicated code to align all card tokens to have the same message.
All card tokens (those having an instance of PaperCard set) now share the same message with no code duplication.
The message has been also update - and so corresponding tests - to include set code in square brackets, and collector number (identified by sharp symbol).
This change will also simplify token formatting in Deck import.

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-29 08:03:39 +01:00
leriomaggio
c9faba36a9 Change to isCardType Matching: from contains to startswith
This is to avoid matching things like "island" as a "land" card type token

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-29 07:30:55 +01:00
leriomaggio
45114fc7e0 DeckRecognizer (and Tokens) extended with support for Banned and Restricted Cards
TokenType instantiated by the DeckRecognizer have been further specialised and extended to also include Banned and Restricted Cards.
Therefore, controls when recognising cards has also been extended and improved.

Now DeckRecognizer include specific extensions for additional constraints imposed by Game Format, Deck Format, release date and art preference. Consequently, all methods used to retrieve cards from CardDb have been updated accordingly, using recognizer settings.

Test suite has been updated accordingly - and all tests re-organised with comments for better code navigation.

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-27 18:53:04 +01:00
Northmoc
40e9f13806 better regex 2021-09-27 13:02:52 -04:00
leriomaggio
2e35935aca new Predicate to get CardEdition with Basic Lands based on Art Preference
A new CardEdition.Predicates has been added to return the CardEdition with all basic lands according to current default Card Art Preference.
This predicate will be used in DeckProxy to getDefaultSet whenever None is specified.
Moreover, quick fix to javadoc and made "isCustomEditions" final.
2021-09-26 00:29:28 +01:00
leriomaggio
5f138b1123 FIX Issue #1974
Fixing NPE occurring when gathering statistics on Card Edition in CardPool and the Edition does not exist.
This patch simply discards any stats about not-found card editions
2021-09-23 12:24:09 +01:00
tool4EvEr
69464e165c Fix Portcullis Vine 2021-09-18 20:20:40 +02:00
leriomaggio
ee35fd9e37 FIX to recognise SB as Sideboard placeholder
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-18 12:17:28 +01:00
leriomaggio
bdd4a7083c New tests and FIX bug on foil request.
Added tests for new setting w/ CardArtPreference and FIX bug on foil request when no edition is specified.

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-18 10:46:31 +01:00
leriomaggio
e6cfafb431 Adding ArtPreference attr to allow for more flexibility when recognising cards
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-17 19:29:03 +01:00
leriomaggio
7d1542ced3 Updating new methods in StaticData to also support a specified CardArtPreference
This artPreference will be passed in by DeckImport for extra flexibility

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-17 19:28:05 +01:00
leriomaggio
3fc4389f30 Restoring back card-parsing first.
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-16 19:18:22 +01:00
leriomaggio
4f86e9d494 adding support to sb as for sideboard, multicolo(u)r and swapping non-token recognition prior to card tokens.
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-16 19:12:35 +01:00
leriomaggio
00723b462c FIX typo in DeckSection extraction from token Key
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-16 18:49:39 +01:00
leriomaggio
02fcc0efb5 FIX incorporating tokenKey with tokenSection if Any
(tokenSection is null for non-legal-card-type token)

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-15 20:07:47 +01:00
leriomaggio
5e1b85c924 Merge remote-tracking branch 'upstream/master' into deck-importer-decks-file-format 2021-09-15 19:36:54 +01:00
Northmoc
489062390b normalize "*+" for Consuming Blob and token 2021-09-15 13:32:32 -04:00