Commit Graph

1629 Commits

Author SHA1 Message Date
Michael Kamensky
74038eefb5 Merge branch 'fixnpe' into 'master'
Fix NPE

See merge request core-developers/forge!5141
2021-07-31 04:47:09 +00:00
Lyu Zong-Hong
ac516168e4 Fix crash when create token with unknown edition 2021-07-31 13:44:38 +09:00
tool4EvEr
39bf803a92 Clean up 2021-07-30 21:39:44 +02:00
leriomaggio
857cf20466 Aligned implementations to add card to pool from cardrequest
Implementation aligned with method getting in cardName, setcode and artIndex.
2021-07-29 13:30:17 +01:00
leriomaggio
e09826a1f0 Improved verification on CardEdition not null for a card (also on date)
When this happens, no card update will be issued!
2021-07-29 12:16:19 +01:00
leriomaggio
beec4915c4 Just cleanup and formattings for getMaxArtIndex and getArtCount 2021-07-28 16:51:32 +01:00
leriomaggio
6ae1a7a5d7 Refined implementation (refactored and optimised) for add method in a CardPool from cardName, Set code and artIndex. 2021-07-28 16:51:10 +01:00
leriomaggio
6726d1f776 New method to retrieve all available databases in a MAP (w/ names)
This method is used in CardPool to add a card, and keep track of the original DB.
2021-07-28 16:50:18 +01:00
leriomaggio
3e63a0c54d Renamed attr. and methods related to "allowCustomCardsInDecksConformance" options and improved API for alternativeCardArt
The new `getAlternativeCardArt` method builds on the previous `getCardFromEdition` which generates alternative card art given a PaperCard and a reference date.
Extension to this method is also incorporated to force the options to adopt for card art preference policy.
If None provided, default options set up in Game preferences will be used!
2021-07-28 16:02:34 +01:00
leriomaggio
dc10c6217e Improved code formatting and extensive refactoring of code for smart card art optimisation
Note: deferred section are still kept alive for live testing. Will be restored and fixed next commit.
2021-07-28 15:59:55 +01:00
leriomaggio
93fa6b28b2 All the logic used in Deck for OptimisedCardArt relating to Pivot Edition and Editions Frequency Map has been now moved in CardPool
CardPool now includes the logic to (a) retrieve the edition frequency map of itself, as well as retrieving its corresponding PivotEdition (depending on cards in the pool).

This refactoring optimises the code in Deck class for "smartCardArt" selection
2021-07-28 15:58:39 +01:00
leriomaggio
1eaf644e5b Renamed and optimised implementation for getTheLatestOfAllTheOriginalEditionsOfCardsIn + tests
`getTheLatestOfAllTheOriginalEditionsOfCardsIn` is the new name for `getEarliestEditionWithAllCards` which better clarifies the intent of the method.
The implementation has been optimised, according to the new CardDb behaviour and APIs.

The tests have been extended to verify that the output of the method is always consistent regardless of the edition of cards in the input CardPool.
2021-07-28 15:56:17 +01:00
leriomaggio
1697c1205f Refined implementation (+ test) for getEarliestEditionWithAllCards
This method should still be optimised, and definetly renamed.
2021-07-28 01:19:41 +01:00
leriomaggio
b893283abc Merge remote-tracking branch 'upstream/master' into collector-number-in-card-list-and-card-db-refactoring 2021-07-28 01:14:00 +01:00
leriomaggio
c8052e00a8 New method processCardList that generates the List of Pair per request.
This method will be also re-used in Decks when inspecting the list of cards to add in a Deck Section.

This refactoring avoids code duplications, and improves modularization.
2021-07-27 17:58:49 +01:00
leriomaggio
f7e85b1f64 Updated with new method call from StaticData to account for conformance of custom cards 2021-07-27 16:16:26 +01:00
leriomaggio
79a4e71968 New test cases (and extended implementation) accounting for cards from UNKNONW sets to be correctly retrieved. 2021-07-27 16:15:25 +01:00
leriomaggio
e5350c83d6 Extended test cases to verify that any CardRequest passed in works with no side effect.
New tests (and fixed updated CardRequest implementation) verify that any method used for Card Retrieval when receiving directly CardRequest formatted strings as cardName won't have any side effect. In particular, the code is reliable to be robust enough to support passing in both card name (only) or a full cardRequest string.

If the latter, any parameter in the request will be updated - accordingly - only when explicit params in function calls are provided.
Also, new tests demonstrate that the current implementation has NO side effect when testing for multiple combinations. Therefore, whatever is requested in requestString won't be overruled, unless really requested too.
2021-07-27 14:31:37 +01:00
Lyu Zong-Hong
26adc5ca7b Get Paper Card for unknown edition 2021-07-27 22:17:10 +09:00
leriomaggio
286533cf90 Aligned CardDb calls after API revision for getCardFromEditionsReleasedBefore(date). 2021-07-27 07:40:13 +01:00
leriomaggio
8de07821e0 Refactoring and Second Update to the new ICardDatabase APIs
This new revision of the APi brings a more consistent distribution of the different parameters and settings in DB API calls.
In particular, the changes affect the getCardFromEditions which are now separated into three sets of methods:

- methods to retrieve a card based on CardArtPreference
- methods to also include a Release Date restriction,
that can be now considered in both directions
(as in "releasedBefore" and "releasedAfter" a specified date).

These changes will be functional for new additions in future changes to Deck Importer, as well as will be used
to refine the implementation of the new Smart Card Art Selection in Decks.

From an implementation perspective, it is important to emphasise that all those methods are just syntactic sugar
for parameter passing to the **same** core (private) retrieval method (centralised single point of failure)
which incorporates all the required parameters, that would also be cumbersome to use in a public API.
2021-07-27 07:40:12 +01:00
Michael Kamensky
c9036f90ef Merge branch 'mdfc' into 'master'
Correctly evaluate modal faces

See merge request core-developers/forge!5112
2021-07-27 04:53:19 +00:00
Lyu Zong-Hong
5f39b98cc5 Also render tokens and emblems when not using images 2021-07-27 12:10:26 +09:00
tool4EvEr
91e8c24769 Clean up 2021-07-26 21:55:48 +02:00
leriomaggio
04ae8fc28a FIX cardDB implementation (and corresponding Tests) for a bug not accounting for too-strict art preference policy for some cards. 2021-07-26 11:31:11 +01:00
tool4EvEr
c3d276f3a9 SealedProduct: fix crash 2021-07-25 18:27:30 +02:00
leriomaggio
e803899d6a Renamed param in constructor for artPreference and BUG FIX in load unknown Card
Even if UNKNOWN card load is enabled, we should check whether the card was not found because of originally filtered.

Therefore, the actual UNKNOWN card will be added now ONLY IF it is not contained in the filtered Blacklist.
2021-07-25 11:17:37 +01:00
leriomaggio
1fecdd255a Simplified attemptToLoadCard by removing extra unused setCode param 2021-07-25 08:45:48 +01:00
leriomaggio
e28f6cf16f Removed useless param from attemptLoadCard 2021-07-25 08:44:22 +01:00
leriomaggio
2d189cda9a Merge remote-tracking branch 'upstream/master' into collector-number-in-card-list-and-card-db-refactoring 2021-07-25 08:09:09 +01:00
leriomaggio
d9620a5556 TEMP implementation of Smart Card Art Selection method 2021-07-24 11:33:37 +01:00
leriomaggio
56080cdf3f Added support to the new Smart Card Art Preference Option
The new "Smart Card Art Selection" option for card images in deck has been added.
The Ui and forge preferences have been updated (default is False), as well as corresponding support in StaticData.
On this note, the old `getAlternativeCardPrint` has been re-implemented to enforce a "Latest_Art" based preference selection so that editions could be selected accordingly (as the smart method was originally designed)

Actual implementation of the method will be part of future commits as still under dev - and requires better encapsulation
2021-07-24 11:07:20 +01:00
leriomaggio
6277bc0c0f Added note on behaviour for candidate w/ no edition
Left note only for (internal) documentation purposes!
2021-07-24 11:02:05 +01:00
leriomaggio
ec89ff755b more robust and reliable method to check for card images
The getImagefile will be invoked since this method will also account for any difference in `full` and `fullborder` naming for card images.
In particular, it will try everything possible before giving up and assume the card has no image.
This is **crucial** for cardDB card retrieval, as well as determines the boolean value returned by PaperCard.hasImage method/property
2021-07-24 10:51:26 +01:00
leriomaggio
4c001b9462 Nothing serious - explicit null initialisation 2021-07-24 10:48:08 +01:00
tool4EvEr
ac6219f4bd Clean up 2021-07-24 11:27:37 +02:00
leriomaggio
513eed297d removed annoying blank line in code formatting :D 2021-07-24 10:09:41 +01:00
Michael Kamensky
004ea04a0e Merge branch 'move-fatpacks-to-editions' into 'master'
Move fatpacks to editions

See merge request core-developers/forge!5102
2021-07-24 05:18:05 +00:00
Michael Kamensky
2b342d7118 Merge branch 'dungeon' into 'master'
Add Dungeon to EditionSectionWithCollectorNumbers

See merge request core-developers/forge!5099
2021-07-24 05:17:57 +00:00
friarsol
6210fdd9fc Move FatPacks to editions file 2021-07-23 22:47:48 -04:00
leriomaggio
01d117b07e Merge remote-tracking branch 'upstream/master' into collector-number-in-card-list-and-card-db-refactoring 2021-07-23 22:38:23 +01:00
tool4EvEr
911511d039 Add Dungeon to EditionSectionWithCollectorNumbers 2021-07-23 21:33:25 +02:00
Lyu Zong-Hong
b28e32460d Fix translation issues for Class and dice rolling cards 2021-07-23 23:40:04 +09:00
leriomaggio
5c27c57f74 New and Refined methods to get and set cart art preferences for all instances of CardDb 2021-07-23 07:57:30 +01:00
leriomaggio
89bdb79d03 New methods (w. tests) to setup card art preferences
CardDb now includes a more refined mechanism to set up values for CardArt Preference.

These methods do now support the proper setup for legacy values and string values (as supported previously in mobile version).
Moreover, new methods are now defined to support the new (separated) pair of settings as integrated into the Desktop App.
2021-07-23 07:45:59 +01:00
Meerkov
b4928378c9 Fix CARDNAME on 6 cards
Some spell descriptions were not properly using CARDNAME. This is relevant because Mutate, etc.
2021-07-22 09:45:01 +00:00
leriomaggio
086b86b9c7 Removed default constructor with no cardArt preference, and so removed the default pref attribute 2021-07-21 17:35:08 +01:00
leriomaggio
a5ee901bba Merge remote-tracking branch 'upstream/master' into collector-number-in-card-list-and-card-db-refactoring 2021-07-21 17:32:02 +01:00
tool4EvEr
a1a326adc6 Minor clean up 2021-07-19 23:20:10 +02:00
Michael Kamensky
e46e1af8c5 [maven-release-plugin] prepare for next development iteration 2021-07-19 07:30:01 +03:00