Commit Graph

2018 Commits

Author SHA1 Message Date
Mark Wiggans
bcaf23c5ff Have ImageCache recognize images with white corners and crop them out 2021-09-11 11:32:37 -04:00
tool4EvEr
052b73bda2 Minor Cleanup 2021-09-11 10:26:01 +02:00
leriomaggio
27ab4c35a3 Re-add to carddb the integration with CardPreferences on Mobile version
On Mobile Forge Port (only) there is the possibility to set a preferred art for a card, from card catalog.
Once a card art is selected, it will always be returned for that specific art whenever no other specific edition is specified.
This commit adds changes to cardDb setPreferredArtMethod (API) and CardRequest.fromString to work with any preferred art (if any).

CardRequests reflects this change by adding another (private) constructor which expects to create a CardRequest from a preferredArt entry in the form of (CardName|SetCode|ArtIndex)
2021-09-10 14:09:25 +01:00
leriomaggio
9d235924ec Re-add to carddb the integration with CardPreferences on Mobile version
On Mobile Forge Port (only) there is the possibility to set a preferred art for a card, from card catalog.
Once a card art is selected, it will always be returned for that specific art.
This commit adds changes to cardDb setPreferredArtMethod (API) and CardRequest.fromString to work with any preferred art (if any).

CardRequests reflects this change by adding another (private) constructor which expects to create a CardRequest from a preferredArt entry in the form of (CardName|SetCode|ArtIndex)
2021-09-10 13:26:30 +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
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
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
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
Anthony Calosa
b355d7fc84 Add Forge SetLogo for Desktop and Mobile
Common, Uncommon, Rare, Mythic and Special Forge logos
2021-08-20 13:22:09 +08:00
Anthony Calosa
6a99ee00f1 Simulation test don't need setlookup 2021-08-16 13:42:05 +08:00
Anthony Calosa
3d322e47ee Support Set lookup for J21 and other future sets.
Forge loads all files found on the setlookup folder.
Example J21.txt (J21 set code) contains a list of set codes (sorted from Newest to Oldest beforehand) to lookup for images on other sets.
2021-08-16 12:06:20 +08:00
leriomaggio
d72d48a11f FIXED bug for unique filter with missing break statement and reverse for correct iteration 2021-08-14 01:10:02 +01:00
leriomaggio
258f57e080 Merge remote-tracking branch 'upstream/master' into collector-number-in-card-list-and-card-db-refactoring 2021-08-13 11:25:38 +01:00
leriomaggio
afaed6fea5 RENEWED and Refined implementation of getUnique for cards, also taking into account current Card Art Preference
getUnique previously returned random results, based on the internal order in which entries were found.

Now, filtering by Unique Cards in Catalog is aware of the current Cart Art Preference
Also, the algorithm takes into account the case in which card image is missing.
In that case, the method tries to fill in the gaps with those alternatives having images. If not possible, the original entries are returned.
2021-08-13 11:14:31 +01:00
leriomaggio
b09b5972ab FORCING all Deck Editors to not have a Unique Cards Only filter 2021-08-13 10:17:51 +01:00
leriomaggio
d171170c45 FIX bug allowing WantUnique filter possible even if alwaysNonUnique is set to true 2021-08-13 10:17:14 +01:00
leriomaggio
beaf98793b Renamed method to retrieve card art preference name and new method to return actual card art preference instance. 2021-08-13 10:15:08 +01:00
leriomaggio
13429991ee Updated method call reflecting the API change in StaticData 2021-08-12 16:18:01 +01:00
leriomaggio
21da278eec Aligned to latest constructor including Artist Name for foiled version. 2021-08-12 15:52:11 +01:00
leriomaggio
f0e1d123b2 FIX Issue #1948
DeckChooser uses it's own `selectedDeckType` to get current selected deck type (instead of querying it from deckComboBox) to update forge perferences, accordingly.
2021-08-11 08:14:47 +01:00
leriomaggio
fd7e5b1bba Added test case to verify that null is returned whenever a request for a card after date of release of latest edition ever is requested. 2021-08-11 00:54:04 +01:00
Michael Kamensky
1a7845117b [maven-release-plugin] prepare for next development iteration 2021-08-07 06:30:54 +03:00
Michael Kamensky
5c768baf64 [maven-release-plugin] prepare release forge-1.6.44 2021-08-07 06:30:45 +03:00
Lyu Zong-Hong
763d509638 Add pure Phyrexian mana symbol for Rage Extractor 2021-08-06 09:46:59 +09:00
leriomaggio
13687a0380 New test for cardDb with lazy card loading
CardDatabaseHelper has been extended to also support a db with lazy card loading.
2021-08-04 16:50:09 +01:00