Commit Graph

52520 Commits

Author SHA1 Message Date
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
John Williams
eeb3d594a1 Update Secret Lair Drop Series.txt 2021-08-23 09:22:09 +00:00
Michael Kamensky
ca6351a6ed Merge branch 'fix_possiblecard_removeaideck' into 'master'
Fix possiblecard with removeaideck

See merge request core-developers/forge!5251
2021-08-23 05:16:11 +00:00
Michael Kamensky
585cc9a955 Merge branch 'Meerkov-master-patch-37226' into 'master'
Unban Absorb Identity for AI

See merge request core-developers/forge!5248
2021-08-23 05:09:07 +00:00
Michael Kamensky
b7d4d91d01 Merge branch 'Meerkov-master-patch-70676' into 'master'
Unban AI from using abunas_chant

See merge request core-developers/forge!5249
2021-08-23 05:08:54 +00:00
Michael Kamensky
c9b204a29d Merge branch 'images' into 'master'
Card Renderer: do not display hidden cards

See merge request core-developers/forge!5250
2021-08-23 05:08:35 +00:00
Michael Kamensky
25fa631344 Merge branch 'fixDelayedDestroySacrifice' into 'master'
cards: fix cards with DelayedTrigger Sacrifice and Destory

See merge request core-developers/forge!5247
2021-08-23 05:06:55 +00:00
Anthony Calosa
f59d1d106d Update PlayEffect.java 2021-08-22 22:44:35 +00:00
Anthony Calosa
5764e95529 Update CopyPermanentEffect.java 2021-08-22 22:42:47 +00:00
TRT
bc1a91186f Card Renderer: do not display hidden cards 2021-08-22 21:14:21 +02:00
Meerkov
fa697d0e60 Unban AI from using abunas_chant 2021-08-22 16:48:02 +00:00
Meerkov
2948d816d0 Unban Absorb Identity for AI 2021-08-22 16:41:08 +00:00
Hans Mackowiak
4c231ace0f cards: fix cards with DelayedTrigger Sacrifice and Destory 2021-08-22 17:56:59 +02:00
Hans Mackowiak
949e338a29 Merge branch 'protection' into 'master'
Fix protection from colorless

See merge request core-developers/forge!5246
2021-08-22 15:01:52 +00:00
TRT
12e9728e01 Fix protection from colorless 2021-08-22 16:55:26 +02:00
Michael Kamensky
512048b185 Merge branch 'timestamp' into 'master'
Fix new timestamp on ETB

Closes #1955

See merge request core-developers/forge!5245
2021-08-22 03:39:13 +00:00
TRT
731803f620 Fix new timestamp on ETB 2021-08-21 22:15:28 +02:00
Anthony Calosa
b80efd103e Merge branch 'master' into 'master'
update textbox tint

See merge request core-developers/forge!5244
2021-08-21 06:29:32 +00:00
Anthony Calosa
b9205b4b1e update textbox tint 2021-08-21 14:20:47 +08:00
Michael Kamensky
2f78d910e1 Merge branch 'manafix' into 'master'
Fix generating mana from negative amount

See merge request core-developers/forge!5243
2021-08-21 03:54:37 +00:00