Commit Graph

1668 Commits

Author SHA1 Message Date
leriomaggio
7664937c93 Updated CardArtPreference Constants value
Also, the CardArtPreference Enum now includes a new methods that allows seamless recognition (and instantiation) of corresponding enum value from Forge Preference - also with backward compatibility.
2021-07-09 20:20:52 +01:00
leriomaggio
d184856d16 Renamed Card Art Preference 2021-07-08 07:47:15 +01:00
leriomaggio
b0c1f1cb0b Merge remote-tracking branch 'upstream/master' into collector-number-in-card-list-and-card-db-refactoring 2021-07-06 08:36:40 +01:00
leriomaggio
574d967cd4 New method to get Art Preference from CardDb, and refined load card method passing on edition from requestInfo
The revised implementation of `attemptToLoadCard` method now also takes into consideration any setcode that may be present into request info.

This is to reduce db lookup operation and returning a card from a very specific set.
2021-07-06 08:21:41 +01:00
leriomaggio
6adfa8b7a7 A few changes to all CardArtPreferences names and set value
Setting the value of card art preference from string now is more reliable, and it falls back automatically to the default
(Latest Art All editions).
This is to allow setting the enum value from Forge Preference Labels.
2021-07-06 08:19:31 +01:00
leriomaggio
91913879e9 Renamed SetPolicy for old art no promo
The new name, i.e. OldArtExcludedPromoAndOnlineEditions is more self-explanatory - a bit long though.

Won't exclude that I will come back at namings after having now worked on CardEdition.Type revision
2021-07-06 08:09:46 +01:00
leriomaggio
42223f109e Merge remote-tracking branch 'upstream/master' into editions-type-review 2021-07-05 09:40:34 +01:00
leriomaggio
81ec996ab3 DRAFT_INNOVATION card edition type renamed as DRAFT
The new name IMHO is easier and more appropriate as a category name.
This would be a mismatch with Scryfall Nomenclature, but Forge contains already mismatch (e.g. REPRINT) so not a big deal.
2021-07-05 08:04:19 +01:00
Hans Mackowiak
5cb384afa2 Grist: Better check for StaticAbility using ExcludeZone, fix timestamp on Stack, and extra rule for canBeCommander 2021-07-04 18:27:31 +02:00
leriomaggio
3906c1f3a5 Merge remote-tracking branch 'upstream/master' into editions-type-review 2021-07-04 00:22:10 +01:00
leriomaggio
c9f0d81d29 Type for Custom editions changed from THIRDPARTY to CUSTOM_SET 2021-07-03 21:04:29 +01:00
Lyu Zong-Hong
be40fce2c6 Implement Dungeon mechanism and related spoiled cards 2021-06-26 18:29:14 +09:00
leriomaggio
bed2d0bddc Merge remote-tracking branch 'upstream/master' into editions-type-review 2021-06-25 17:08:45 +01:00
friarsol
dc886b139a Add full availability of other booster types 2021-06-22 23:36:12 -04:00
friarsol
2619cca56f Add support for collector boosters 2021-06-21 21:44:54 -04:00
leriomaggio
79f4595292 Merge remote-tracking branch 'upstream/master' into editions-type-review 2021-06-21 11:45:15 +01:00
leriomaggio
3ba464665e New methods returning a map of all editions per type.
This method is used to populate the "Sets" advanced filters in UI (so far, desktop only)
2021-06-21 11:43:51 +01:00
leriomaggio
844360fb34 CardEdition.Type now includes new methods for String representation (UI) 2021-06-21 11:43:01 +01:00
Lyu Zong-Hong
c7d7130344 Update oracle for MH2 release 2021-06-19 12:47:36 +09:00
leriomaggio
e8b6e066e3 Updated types in CardEdition enum 2021-06-16 07:25:38 +01:00
leriomaggio
b79fc195a1 Updaetd PROMO type from (old) PROMOS 2021-06-13 20:39:42 +01:00
leriomaggio
b8aaf8fb68 New Card Types categories also for custom editions
Card Editions now includes updated Types, following the new remapping.

Moreover, a new option to CardEdition.Reader has been added (in the constructor) in order to account for custom editions.

So far this new "reading mode" accounts for type that is "forced" always to be "THIRDPARTY" so to guarantee consistent sets filtering (so far only on Mobile platform).
This new option is integrated in StaticData when instantiating the collection for CustomEditions.
2021-06-13 20:23:34 +01:00
Michael Kamensky
4e1c6cb678 [maven-release-plugin] prepare for next development iteration 2021-06-12 16:30:00 +03:00
Michael Kamensky
7e1fd332e0 [maven-release-plugin] prepare release forge-1.6.42 2021-06-12 16:29:51 +03:00
Michael Kamensky
368c2f9796 [maven-release-plugin] prepare for next development iteration 2021-06-12 16:13:39 +03:00
Michael Kamensky
d658df35d6 [maven-release-plugin] prepare release forge-1.6.41 2021-06-12 16:13:31 +03:00
Michael Kamensky
c07f3ea34d Merge branch 'master' of git.cardforge.org:core-developers/forge into agetian-master 2021-06-11 07:50:33 +03:00
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
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
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
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
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
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
leriomaggio
3704204371 Refactoring: Using IPaperCard constant for artIndex instead of hard coded number 2021-06-06 14:55:14 +01:00
leriomaggio
7dfc48744c Merge remote-tracking branch 'upstream/master' into patch-imagefetcher-scryfall 2021-06-05 17:00:53 +01:00
Michael Kamensky
1633dedee3 Merge branch 'master' of git.cardforge.org:core-developers/forge into agetian-master 2021-06-05 17:34:06 +03:00
Michael Kamensky
1f2cc92533 Merge branch 'phasing' into 'master'
Phasing Fixes

Closes #531

See merge request core-developers/forge!4808
2021-06-05 14:27:11 +00:00
leriomaggio
2e550b95ca New Card Language option to support fetching cards in different languages 2021-06-05 15:21:49 +01:00
leriomaggio
ace7998c40 Removed unused method 2021-06-05 15:17:10 +01:00
leriomaggio
e2b30b8f71 Extended Regexp to support Historic Anthology 5 CN types
Historic Anthology 5 introduced a new "type" of collector number, namely
"999-CH". Regexp has been extended to also include those cases.
2021-06-05 10:50:16 +01:00