change skip list initialization (#10967)

This commit is contained in:
Evan Kranzler 2023-08-23 19:19:55 -04:00 committed by GitHub
parent d0ea5f8bc9
commit 921b640c33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -111,26 +111,26 @@ public class VerifyCardDataTest {
// can be full set ignore list or set + cardname // can be full set ignore list or set + cardname
// power-toughness // power-toughness
skipListCreate(SKIP_LIST_PT); // skipListAddName(SKIP_LIST_PT, set, cardName);
// loyalty // loyalty
skipListCreate(SKIP_LIST_LOYALTY); // skipListAddName(SKIP_LIST_LOYALTY, set, cardName);
// defense // defense
skipListCreate(SKIP_LIST_DEFENSE); // skipListAddName(SKIP_LIST_DEFENSE, set, cardName);
// color // color
skipListCreate(SKIP_LIST_COLOR); // skipListAddName(SKIP_LIST_COLOR, set, cardName);
// cost // cost
skipListCreate(SKIP_LIST_COST); // skipListAddName(SKIP_LIST_COST, set, cardName);
skipListAddName(SKIP_LIST_COST, "WOE", "Scream Puff"); //temporary skipListAddName(SKIP_LIST_COST, "WOE", "Scream Puff"); //temporary
// supertype // supertype
skipListCreate(SKIP_LIST_SUPERTYPE); // skipListAddName(SKIP_LIST_SUPERTYPE, set, cardName);
// type // type
skipListCreate(SKIP_LIST_TYPE); // skipListAddName(SKIP_LIST_TYPE, set, cardName);
skipListAddName(SKIP_LIST_TYPE, "UNH", "Old Fogey"); // uses summon word as a joke card skipListAddName(SKIP_LIST_TYPE, "UNH", "Old Fogey"); // uses summon word as a joke card
skipListAddName(SKIP_LIST_TYPE, "UND", "Old Fogey"); skipListAddName(SKIP_LIST_TYPE, "UND", "Old Fogey");
skipListAddName(SKIP_LIST_TYPE, "UST", "capital offense"); // uses "instant" instead "Instant" as a joke card skipListAddName(SKIP_LIST_TYPE, "UST", "capital offense"); // uses "instant" instead "Instant" as a joke card
@ -140,7 +140,7 @@ public class VerifyCardDataTest {
skipListAddName(SKIP_LIST_TYPE, "WOE", "Redtooth Vanguard"); //temporary skipListAddName(SKIP_LIST_TYPE, "WOE", "Redtooth Vanguard"); //temporary
// subtype // subtype
skipListCreate(SKIP_LIST_SUBTYPE); // skipListAddName(SKIP_LIST_SUBTYPE, set, cardName);
skipListAddName(SKIP_LIST_SUBTYPE, "UGL", "Miss Demeanor"); // uses multiple types as a joke card: Lady, of, Proper, Etiquette skipListAddName(SKIP_LIST_SUBTYPE, "UGL", "Miss Demeanor"); // uses multiple types as a joke card: Lady, of, Proper, Etiquette
skipListAddName(SKIP_LIST_SUBTYPE, "UGL", "Elvish Impersonators"); // subtype is "Elves" pun skipListAddName(SKIP_LIST_SUBTYPE, "UGL", "Elvish Impersonators"); // subtype is "Elves" pun
skipListAddName(SKIP_LIST_SUBTYPE, "UND", "Elvish Impersonators"); skipListAddName(SKIP_LIST_SUBTYPE, "UND", "Elvish Impersonators");
@ -150,24 +150,23 @@ public class VerifyCardDataTest {
skipListAddName(SKIP_LIST_SUBTYPE, "WOE", "Redtooth Vanguard"); //temporary skipListAddName(SKIP_LIST_SUBTYPE, "WOE", "Redtooth Vanguard"); //temporary
// number // number
skipListCreate(SKIP_LIST_NUMBER); // skipListAddName(SKIP_LIST_NUMBER, set, cardName);
// rarity // rarity
skipListCreate(SKIP_LIST_RARITY); // skipListAddName(SKIP_LIST_RARITY, set, cardName);
skipListAddName(SKIP_LIST_RARITY, "CMR", "The Prismatic Piper"); // Collation is not yet set up for CMR https://www.lethe.xyz/mtg/collation/cmr.html skipListAddName(SKIP_LIST_RARITY, "CMR", "The Prismatic Piper"); // Collation is not yet set up for CMR https://www.lethe.xyz/mtg/collation/cmr.html
skipListAddName(SKIP_LIST_RARITY, "WOE", "Picklock Prankster"); // temporary skipListAddName(SKIP_LIST_RARITY, "WOE", "Picklock Prankster"); // temporary
skipListAddName(SKIP_LIST_RARITY, "WOE", "Free the Fae"); // temporary skipListAddName(SKIP_LIST_RARITY, "WOE", "Free the Fae"); // temporary
skipListAddName(SKIP_LIST_RARITY, "WOE", "Up the Beanstalk"); // temporary skipListAddName(SKIP_LIST_RARITY, "WOE", "Up the Beanstalk"); // temporary
// missing abilities // missing abilities
skipListCreate(SKIP_LIST_MISSING_ABILITIES); // skipListAddName(SKIP_LIST_MISSING_ABILITIES, set, cardName);
// double rare cards // double rare cards
skipListCreate(SKIP_LIST_DOUBLE_RARE); // skipListAddName(SKIP_LIST_DOUBLE_RARE, set, cardName);
// Un-supported sets (mtgjson/scryfall contains that set but xmage don't implement it) // Un-supported sets (mtgjson/scryfall contains that set but xmage don't implement it)
// Example: Non-English or empty sets: Token sets, Archenemy Schemes, Plane-Chase Planes, etc. // Example: Non-English or empty sets: Token sets, Archenemy Schemes, Plane-Chase Planes, etc.
skipListCreate(SKIP_LIST_UNSUPPORTED_SETS);
// //
// Non-English-only sets should not be added. https://github.com/magefree/mage/pull/6190#issuecomment-582354790 // Non-English-only sets should not be added. https://github.com/magefree/mage/pull/6190#issuecomment-582354790
skipListAddName(SKIP_LIST_UNSUPPORTED_SETS, "4BB"); // 4th Edition Foreign black border. skipListAddName(SKIP_LIST_UNSUPPORTED_SETS, "4BB"); // 4th Edition Foreign black border.
@ -237,7 +236,6 @@ public class VerifyCardDataTest {
skipListAddName(SKIP_LIST_UNSUPPORTED_SETS, "PTG"); // Ponies: The Galloping skipListAddName(SKIP_LIST_UNSUPPORTED_SETS, "PTG"); // Ponies: The Galloping
// wrond card numbers skip list // wrond card numbers skip list
skipListCreate(SKIP_LIST_WRONG_CARD_NUMBERS);
skipListAddName(SKIP_LIST_WRONG_CARD_NUMBERS, "SWS"); // Star Wars skipListAddName(SKIP_LIST_WRONG_CARD_NUMBERS, "SWS"); // Star Wars
skipListAddName(SKIP_LIST_WRONG_CARD_NUMBERS, "UND"); // un-sets don't have full implementation of card variations skipListAddName(SKIP_LIST_WRONG_CARD_NUMBERS, "UND"); // un-sets don't have full implementation of card variations
skipListAddName(SKIP_LIST_WRONG_CARD_NUMBERS, "UST"); // un-sets don't have full implementation of card variations skipListAddName(SKIP_LIST_WRONG_CARD_NUMBERS, "UST"); // un-sets don't have full implementation of card variations
@ -251,13 +249,11 @@ public class VerifyCardDataTest {
// scryfall download sets (missing from scryfall website) // scryfall download sets (missing from scryfall website)
skipListCreate(SKIP_LIST_SCRYFALL_DOWNLOAD_SETS);
skipListAddName(SKIP_LIST_SCRYFALL_DOWNLOAD_SETS, "SWS"); // Star Wars skipListAddName(SKIP_LIST_SCRYFALL_DOWNLOAD_SETS, "SWS"); // Star Wars
// sample decks checking - some decks can contains unimplemented cards, so ignore it // sample decks checking - some decks can contains unimplemented cards, so ignore it
// file name must be related to sample-decks folder // file name must be related to sample-decks folder
// for linux/windows build system use paths constructor // for linux/windows build system use paths constructor
skipListCreate(SKIP_LIST_SAMPLE_DECKS);
skipListAddName(SKIP_LIST_SAMPLE_DECKS, Paths.get("Jumpstart", "jumpstart_custom.txt").toString()); // it's not a deck file skipListAddName(SKIP_LIST_SAMPLE_DECKS, Paths.get("Jumpstart", "jumpstart_custom.txt").toString()); // it's not a deck file
skipListAddName(SKIP_LIST_SAMPLE_DECKS, Paths.get("Commander", "Commander 2019", "Merciless Rage.dck").toString()); // TODO: delete after Aeon Engine implemented skipListAddName(SKIP_LIST_SAMPLE_DECKS, Paths.get("Commander", "Commander 2019", "Merciless Rage.dck").toString()); // TODO: delete after Aeon Engine implemented
} }
@ -268,25 +264,25 @@ public class VerifyCardDataTest {
private int wrongAbilityStatsGood = 0; private int wrongAbilityStatsGood = 0;
private int wrongAbilityStatsBad = 0; private int wrongAbilityStatsBad = 0;
private static void skipListCreate(String listName) { private static Set<String> skipListGet(String listName) {
skipCheckLists.put(listName, new LinkedHashSet<>()); return skipCheckLists.computeIfAbsent(listName, x -> new LinkedHashSet<>());
} }
private static void skipListAddName(String listName, String set, String cardName) { private static void skipListAddName(String listName, String set, String cardName) {
skipCheckLists.get(listName).add(set + " - " + cardName); skipListGet(listName).add(set + " - " + cardName);
} }
private static void skipListAddName(String listName, String set) { private static void skipListAddName(String listName, String set) {
skipCheckLists.get(listName).add(set); skipListGet(listName).add(set);
} }
private static boolean skipListHaveName(String listName, String set, String cardName) { private static boolean skipListHaveName(String listName, String set, String cardName) {
return skipCheckLists.get(listName).contains(set + " - " + cardName) return skipListGet(listName).contains(set + " - " + cardName)
|| skipCheckLists.get(listName).contains(set); || skipListGet(listName).contains(set);
} }
private static boolean skipListHaveName(String listName, String set) { private static boolean skipListHaveName(String listName, String set) {
return skipCheckLists.get(listName).contains(set); return skipListGet(listName).contains(set);
} }
private static boolean evergreenCheck(String s) { private static boolean evergreenCheck(String s) {