Commit Graph

52558 Commits

Author SHA1 Message Date
leriomaggio
cb82fc2f4b Removed unused imports 2021-08-27 20:56:43 +01:00
leriomaggio
27399440dd Merge remote-tracking branch 'upstream/master' into patch-carddb-performance 2021-08-27 20:05:49 +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
7a7b23e593 Replacing with Lists.sort for better performance 2021-08-27 20:02:47 +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
ad7cad9a56 Added to iPaperCard new methods to get card art (alternate) keys, and whether there is a BackFace
These new methods will be used to cache the values of Image keys, as well as to determine whether a card has an alternate image (and so key).

Methods on CardImageKeys have been distinguished in names to not confuse them with similar names (but completely different use and output) from InventoryItems interface.
CardImageKeys for PaperCard are also cached in private attribute to reduce OPS in Card Catalogs that are consistently the same.
As for Tokens, the output of these two new methods is the same as getImageKey.

These methods have been also moved to interface (and so class) as this would result in better encapsulation (esp. hasBackFace - using CardRules within the card - similar to `Card` class).

ImageUtil.getImageKey calls will be replaced with these methods, limiting their use only to downloaders (when set attribute can be added or not). PaperCard will always add the set info).
2021-08-27 17:22:10 +01:00
Michael Kamensky
3ded936e03 Merge branch 'johnwilliams7-master-patch-21835' into 'master'
Update Promos

See merge request core-developers/forge!5261
2021-08-27 14:16:08 +00:00
Anthony Calosa
7e02aebb86 Merge branch 'patch-carddb-performance' into 'master'
FIX in ImageKeys.hasImage removing Pattern.quote for //

See merge request core-developers/forge!5262
2021-08-27 11:37:32 +00:00
leriomaggio
172c170b2d Merge remote-tracking branch 'upstream/master' into patch-carddb-performance 2021-08-27 12:13:23 +01:00
leriomaggio
dbe0e15674 FIX in ImageKeys.hasImage removing Pattern.quote for //
Pattern.quote has some corner cases on MAC not working (`ME/` ended up in three splits).
Resorted back to `//` as the key will never be a true file path anyway!
2021-08-27 12:12:57 +01:00
John Williams
6a9441b211 Add new file 2021-08-27 08:43:46 +00:00
John Williams
100bd57f24 Update Wizards Play Network 2021.txt 2021-08-27 08:37:26 +00:00
John Williams
3d2cf97b7f Update Magazine Inserts.txt 2021-08-27 08:34:26 +00:00
Michael Kamensky
33850f45ce Merge branch 'statics' into 'master'
Fixes for triggers depending on payment

See merge request core-developers/forge!5257
2021-08-27 08:23:49 +00:00
Anthony Calosa
905a855321 Merge branch 'patch-carddb-performance' into 'master'
FIX in ImageKeys.hasImage for Windows users

See merge request core-developers/forge!5260
2021-08-27 08:15:01 +00:00
leriomaggio
50dded5169 FIX in ImageKeys.hasImage using Pattern.quote to allow for Windows compatibility 2021-08-27 09:04:32 +01:00
Michael Kamensky
be34d5ee6c Merge branch 'patch-carddb-performance' into 'master'
CardDb Optimisations

See merge request core-developers/forge!5258
2021-08-27 04:20:40 +00:00
Michael Kamensky
6c41f6ad0d Merge branch 'random_lands_from_block_Momir' into 'master'
Random lands from block set code for Momir, MoJhoSto

See merge request core-developers/forge!5259
2021-08-26 08:50:54 +00:00
Anthony Calosa
290140bca3 Update GameType.java 2021-08-26 07:31:39 +00:00
leriomaggio
fb3db3d83a removed unused import 2021-08-26 08:05:53 +01:00
leriomaggio
970d9b4b8d removed unused import 2021-08-26 08:04:26 +01:00
leriomaggio
26ec34e019 Updated tests and capped artIndex to be two digits! 2021-08-26 07:23:09 +01:00
Anthony Calosa
7c56d50192 addAny must be random art 2021-08-26 05:43:41 +00:00
Anthony Calosa
9c172833e8 Update GameType.java 2021-08-26 04:45:44 +00:00
Anthony Calosa
74f86aa0c6 Update CardPool.java 2021-08-26 04:33:38 +00:00
Anthony Calosa
62ac73c916 Update CardPool.java 2021-08-26 04:12:37 +00:00
Anthony Calosa
35ded5bd95 Update GameType.java 2021-08-26 04:12:05 +00:00
Anthony Calosa
cb06cf9029 Update GameType.java 2021-08-26 03:55:12 +00:00
Anthony Calosa
cb82d570eb Update FModel.java 2021-08-26 03:48:01 +00:00
Anthony Calosa
847d165300 Update StaticData.java 2021-08-26 03:43:43 +00:00
leriomaggio
18a537bb5e Merge remote-tracking branch 'upstream/master' into patch-carddb-performance 2021-08-26 03:03:25 +01:00
leriomaggio
4fc0234ccc Improved performance w/ cached content for ImageKeys.hasImage
THe content of the setFolder is cached, filtering only images and key prefixes.
Working on prefixes only to get rid of all .full or .fullborder possible variations.
2021-08-26 03:02:52 +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
dde96156be Simplified condition on artIndex when retrieving relative path for card image. 2021-08-26 02:49:26 +01:00
leriomaggio
119ac88ad5 PaperCard now includes an ImageKeyFromSet attr. cached for later re-use! 2021-08-26 02:48:57 +01:00
leriomaggio
6fef56c8b7 Simplified isDirectoryWithFiles reducing I/O ops
(as per Grimm suggestions!)
2021-08-26 02:48:15 +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
TRT
811766a77f Fixes for triggers depending on payment 2021-08-25 21:06:57 +02: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
f507edada5 Same optimisation using iterator on getCardFromSet 2021-08-25 18:49:03 +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
Michael Kamensky
7462f796ec Merge branch 'cascade' into 'master'
Fix Cascade from opponents zone

See merge request core-developers/forge!5228
2021-08-25 17:07:12 +00:00
Bug Hunter
dddacd5215 Fix Cascade from opponents zone 2021-08-25 17:07:11 +00:00