Commit Graph

53641 Commits

Author SHA1 Message Date
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
leriomaggio
5608b110f8 Merge remote-tracking branch 'upstream/master' into deck-importer-decks-file-format 2021-08-25 08:44:50 +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
ad6acca93d Merge branch 'master' of git.cardforge.org:core-developers/forge into agetian-master 2021-08-23 08:11:47 +03: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
leriomaggio
e165805b8c Updated dialog mobile deck import (removed useless field) + translations 2021-08-23 00:33:44 +01:00
leriomaggio
a4982b29a9 Updated and NEW labels related to Deck Import and controllers.
Current labels have not been extended yet to other languages.
2021-08-23 00:08:38 +01:00
leriomaggio
7c2a2de12f Updates to new card formats, and support for new token types.
DeckRecognizer is **the** core of the new Deck Import functionalities.
DeckRecognizer has been extended with more flexible, and alternative reg/exp for better card recognition, as well as Deck sections, card types, and deck name.

When retrieving cards from the db, the recogniser will also incorporate validation to check against illegal (from set) or banned cards considering current game/deck format.

The new set of regexp guarantee support for several M:TG deck format, including deckstats.net; tappedout; mtg-arena; mtgo
2021-08-23 00:02:58 +01:00
leriomaggio
697cbcca18 Updated constructor invocation for DeckImport 2021-08-22 23:59:29 +01:00
leriomaggio
dc845b1f67 Improved controller to incorporate restrictions from game and deck formats
The new controller has been extended with new attributes to enable the validation to cards recognised from card list performed by DeckRecognizer.
in particular, the controller will keep track of current game format (i.e. allowedSetCodes), as well as current deck format.
Lastly, it extends support for import/replace deck
2021-08-22 23:58:56 +01:00
leriomaggio
e220d2157a Extended loadDeck method to support the non-complete replacement of underline model
The loadDeck overloading support passing in a boolean flag to check whether current deck (if any) should be erased or not.
This will be useful when importing cards with deck importer without clearing current deck.
2021-08-22 23:56:02 +01:00
leriomaggio
a6b590df61 New version of the Deck Import with support for new tokens, and more
First round of improvements to deck import now including the current game type in the title - and so keep track of current deck format.
This will be particularly relevant for the improved DeckRecognizer which incorporates a new validation mechanism for on-the-fly card validation.

Now Deck Importer also include a very thorough set of instructions as welcome message (still WIP - to be updated and refined!)

Last but not least, there is automatic option to Import cards, or to Replace current deck (if any)
2021-08-22 23:53:41 +01:00
leriomaggio
0b9a0f41cd Added method to make current game type accessible 2021-08-22 23:49:47 +01: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
leriomaggio
0f8541154a Added method to **set** the name of a Deck
name attribute is now also accessible in write. This will make possible to set the name of a deck after the import process.
2021-08-22 23:30:06 +01:00
leriomaggio
89687a45ed Deck now integrates validation of Deck Sections
Validation of Deck Sections is applied only once per deck.
2021-08-22 23:28:48 +01:00
leriomaggio
057213342c DeckSection have been extended in order to support validation
Each section requiring Validation, now can incorporate a method for sanity check. This will be useful when the deck importer will import cards that are placed in the wrong section in the list.
2021-08-22 23:27:52 +01:00
leriomaggio
2950a567d8 New Method to filter a card pool based on a Predicate
This method will be used during the validation of each deck section.
2021-08-22 23:26:19 +01:00
leriomaggio
f541199cca New test cases for new methods + a few tests to check predicates and get cards by name 2021-08-22 23:25:19 +01:00
leriomaggio
215c47b61d Updated with new API methods implementations & new compose for request
CardRequest now include a compose (parameter) alternative to just create a CardRequest by name, and/or a boolean flag.
Other changes include actual implementation of the new API methods (see prev. commit)
2021-08-22 23:13:17 +01:00
leriomaggio
4448cfca68 Extended DB API with pair of new methods
GetCardFromEditions (series of) methods now support to specify
a Predicate to filter the set of available candidates when gathering all the same card prints (by name).

For this reason, a new Predicate (isLegal) has been added to include limitations (filtering) based on set codes.

getAllCards method now include the possibility to provide a predicate
as a filter.
2021-08-22 23:10:53 +01: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