Commit Graph

51686 Commits

Author SHA1 Message Date
leriomaggio
18febc5af0 Merge remote-tracking branch 'upstream/master' into collector-number-in-card-list-and-card-db-refactoring 2021-06-09 19:33:01 +01:00
leriomaggio
6ba081f1a0 getReplacementCard got a more significant name to also be used in DeckController 2021-06-09 19:06:28 +01:00
leriomaggio
7bcc4b46e1 Removed useless artIndex parameter 2021-06-09 19:04:38 +01:00
leriomaggio
2a8f80195d Removed ambiguities in test cases due to new CardDb methods with default cardart option 2021-06-09 19:04:21 +01:00
leriomaggio
0c813024d2 First improvement to API in convertXitaxMethod simplifying implementation thanks to new CardDb API 2021-06-09 18:51:08 +01:00
leriomaggio
319cb5515c Updated PaperCard constructor to safely set Art index when negative values are passed in. 2021-06-09 17:53:05 +01:00
leriomaggio
b18c1f7cec Updated test imports 2021-06-09 17:52:13 +01:00
leriomaggio
448263d9de Comment (and test!) to demonstrate that current implementation of getEarliestEditionWithAllCards not only has a misleading name, but also doesn't work the way it should! 2021-06-09 17:48:07 +01:00
leriomaggio
58b2a96168 Updates for New CardDb API [getAllCards(edition)] 2021-06-09 17:47:09 +01:00
leriomaggio
c53899d8c9 Updates with new API relying on default cardArt option 2021-06-09 17:46:42 +01:00
leriomaggio
b17ea15935 Updates with new renamed CardArtPreference options in CardDb 2021-06-09 17:44:55 +01:00
leriomaggio
87257f0413 Using IPaperCard constants for ArtIndex instead of hard coded values when adding cards to pool 2021-06-09 17:44:07 +01:00
tool4EvEr
084476b8b0 Clean up 2021-06-09 18:43:34 +02:00
leriomaggio
22b1abece5 Updated API call to CardDB with getCardFromEditions w/ LatestPrint
Probably the specs of the policy hard coded could be removed, but requires more investigation before doing it.
2021-06-09 17:43:11 +01:00
leriomaggio
2c2f6f6f31 Updated API call to CardDB with getCardFromEditions w/ OldPrint 2021-06-09 17:40:29 +01:00
leriomaggio
5ad05f94ad Updated API call to CardDB with getArtCount and getMaxArtIndex 2021-06-09 17:35:18 +01:00
leriomaggio
58cfbf4c0d Updated API call to CardDB with PreferredCardArt
Note: the `convertByXitaxMethod` will be soon discontinued thanks to the new upcoming option and API.
Same will apply to those methods in StaticData
2021-06-09 17:33:37 +01:00
leriomaggio
eb9899e405 Updates to ITokenAPI aligned with Cards' Interface. 2021-06-09 17:26:12 +01:00
leriomaggio
8ea2f18fda Updates to StaticData to pass on preferredArt to CardDb constructor and new CardArtPreference enum. 2021-06-09 17:24:57 +01:00
leriomaggio
f21612c2c4 Major Update to CardDb (along with tests).
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.
2021-06-09 17:22:42 +01:00
leriomaggio
20386462ce Base PowerMock Test case for CardDb testing
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.
2021-06-09 17:01:04 +01:00
leriomaggio
48859a32a3 ITokenDatabase API have been aligned in names with those for cards. 2021-06-09 16:59:14 +01:00
leriomaggio
dad3cafd7a IPaperCard now includes a constant placeholder for NO Art Index.
This is an attempt to start removing all the hard-coded values
used throughout the code base whenever art index should be
invoked, by relying on a more stable approach based on
constants.
2021-06-09 16:58:48 +01:00
leriomaggio
d4c19a0a1f Complete Refactoring of the CardDb API
The API for Magic Card Database has been refactored so to include card look up methods as organised in three main categories:
- single card lookup based on details (name, ed code, collector number)
- card lookup from a given edition (i.e. CardEdition instance)
- card lookup based on Art Preference

Methods to retrieve collection of cards have been renamed to allow
for overloading, within a more consistent API.
Same for utility methods to retrieve cards' art index and count.

Last but not least, the old "getFoiled" method has been removed to leave space to the new method in PaperCard API.
2021-06-09 16:57:09 +01:00
Lyu Zong-Hong
f9abb8ca75 Add Garth One-Eye and necessary support 2021-06-09 23:07:55 +09:00
tool4EvEr
4b0c748eaf Fix Myr Battlesphere allowing you to tap for X = 0 2021-06-09 11:40:11 +02:00
tool4EvEr
083674071b Reset xPaid after ability resolved 2021-06-09 11:40:01 +02:00
tool4EvEr
96ccf0afc6 More small fixes 2021-06-09 09:43:02 +02:00
Michael Kamensky
cfb755ce20 Merge branch 'clean' into 'master'
Small fixes

See merge request core-developers/forge!4854
2021-06-09 05:52:47 +00:00
tool4EvEr
cc8753b563 Small fixes 2021-06-08 23:17:55 +02:00
Michael Kamensky
454c51f1b1 Merge branch 'fix' into 'master'
Various card patches

See merge request core-developers/forge!4831
2021-06-08 14:56:34 +00:00
Michael Kamensky
fa83326710 Merge branch 'mh2_7' into 'master'
MH2 - 7 June

See merge request core-developers/forge!4848
2021-06-08 14:55:48 +00:00
Northmoc
eb60690973 viashino_lashclaw.txt add AILogic 2021-06-08 10:17:43 -04:00
Northmoc
0983c72ea0 viashino_lashclaw.txt 2021-06-08 10:17:42 -04:00
Northmoc
49436a00b3 graceful_restoration.txt 2021-06-08 10:17:42 -04:00
Northmoc
8345bf890b glimmer_bairn.txt 2021-06-08 10:17:42 -04:00
Northmoc
5b2980562b emergent_growth.txt clean up stackdesc 2021-06-08 10:16:03 -04:00
Northmoc
b86249635f drake_stone.txt fix ManaCost 2021-06-08 10:16:03 -04:00
Northmoc
4286429402 gravebreaker_lamia.txt add Mandatory 2021-06-08 10:16:02 -04:00
Michael Kamensky
6578fb79e6 Merge branch 'master' into 'master'
Net Decks Archive Updates - New Gauntlets

See merge request core-developers/forge!4852
2021-06-08 10:33:26 +00:00
Bug Hunter
f1169511ab Merge branch 'TRT-master-patch-20578' into 'master'
Update forge-gui/res/cardsfolder/b/bog_rats.txt

Closes #1883

See merge request core-developers/forge!4853
2021-06-08 07:33:29 +00:00
Bug Hunter
6f5f04bb7e Update forge-gui/res/cardsfolder/b/bog_rats.txt 2021-06-08 07:32:14 +00:00
Churrufli
b33595d840 Net Decks Archive Updates - New Gauntlets 2021-06-08 09:25:52 +02:00
Churrufli
653b484674 Net Decks Archive Updates - New Gauntlets 2021-06-08 09:16:34 +02:00
Michael Kamensky
5a0a63940d Merge branch 'typefix' into 'master'
Fix missing type

See merge request core-developers/forge!4849
2021-06-08 03:31:57 +00:00
Michael Kamensky
d734fdf761 Merge branch 'fixnpe' into 'master'
Fix NPE with Grakmaw when run from ChooseType

See merge request core-developers/forge!4850
2021-06-08 03:31:41 +00:00
tool4EvEr
3ab7fcf224 Fix NPE with Grakmaw when run from ChooseType 2021-06-07 22:40:16 +02:00
tool4EvEr
4f4fe04683 Fix missing type 2021-06-07 22:08:21 +02:00
Michael Kamensky
c83d03a2d6 Merge branch 'H1R' into 'master'
RMH1 to H1R fix

See merge request core-developers/forge!4847
2021-06-07 18:28:45 +00:00
leriomaggio
c5f283eaa7 Updated all test-packages dependencies w/ corresponding versions 2021-06-07 18:22:26 +01:00