Commit Graph

52339 Commits

Author SHA1 Message Date
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
leriomaggio
d8f19fdda2 First CardDb optimisation - reusing same strategy for lazyLoading
There was a FIXME/TODO comment I just have found out relating to putCard implementation being inefficient.
I've re-used the new-methods implemented for lazyCardLoading to improve existing implementation.
Also, now all the PaperCard constructors won't miss collectorNumber and ArtistNames as gathered from CardInSet in CardEdition - YAY
2021-08-25 12:28:13 +01: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
c726cf6fb0 Various Optimisations for re-use and removed dead-code
Various optimisation to the PaperCard implementation:

- removed once and for all retrieveCollectorNumber method - we're now safe and sound that all PaperCard instances will have a collector Number matched.

- That is also made sure by removing all the many (legacy) class constructors. Only left two - with correct parameter passing!

- finally, collectorNumberSortingKey is created onces, and saved - as this won't change (for better performance)
2021-08-25 12:22:02 +01:00
leriomaggio
0db01499b3 Returning correct foiled card (no code reps) 2021-08-25 12:19:19 +01:00
leriomaggio
b49fe104fc Added constant for NO artist name (for later re-use) 2021-08-25 12:18:53 +01:00
leriomaggio
fb27b66621 Added docstring to getCardInSet method 2021-08-25 12:07:00 +01:00
Michael Kamensky
cecaf5e7ea Merge branch 'changedCardKeywordsTraitsTable' into 'master'
Card: use TreeTable for changes Keywords and Traits

See merge request core-developers/forge!5256
2021-08-25 04:41:43 +00:00
Hans Mackowiak
a7a1dddf85 Card: use TreeTable for changes Keywords and Traits 2021-08-24 19:22:47 +02:00
Michael Kamensky
1db47de281 Merge branch 'SLD' into 'master'
SLD Update

See merge request core-developers/forge!5255
2021-08-24 09:55:40 +00:00
paul_snoops
1ca3483664 SLD Update 2021-08-24 10:07:49 +01:00
Michael Kamensky
f052372d22 Merge branch 'choosenum' into 'master'
fix ChooseNumberEffect range for random

See merge request core-developers/forge!5253
2021-08-23 16:06:24 +00:00
Michael Kamensky
0e1033a075 Merge branch 'Meerkov-master-patch-21510' into 'master'
Unban AI - Wu Spy

See merge request core-developers/forge!5254
2021-08-23 16:05:52 +00:00
Michael Kamensky
5a51c896d2 Merge branch 'johnwilliams7-master-patch-76098' into 'master'
Update Secret Lair Drop Series.txt

See merge request core-developers/forge!5252
2021-08-23 16:05:35 +00:00
Meerkov
d769e4f80b Unban AI - Wu Spy 2021-08-23 15:35:38 +00:00
Northmoc
1a2229afe6 fix ChooseNumberEffect range for random 2021-08-23 08:05:48 -04:00