mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 04:42:07 -08:00
Change supertype method in constructors (#10361)
* replace addSuperType with supertype.add in card constructors * more supertype replacements * update MDFC supertype implementation * remove unnecessary class * update test
This commit is contained in:
parent
4cc9329b15
commit
a850e3660b
2452 changed files with 2651 additions and 2731 deletions
|
|
@ -8,7 +8,6 @@ import mage.cards.ExpansionSet;
|
|||
import mage.cards.ModalDoubleFacesCard;
|
||||
import mage.cards.repository.CardInfo;
|
||||
import mage.cards.repository.CardScanner;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.draft.RemixedSet;
|
||||
|
|
@ -110,24 +109,24 @@ public class BoosterGenerationTest extends MageTestBase {
|
|||
Assert.assertNotNull(booster);
|
||||
Assert.assertEquals("Pack contains 15 cards", 15, booster.size());
|
||||
|
||||
Assert.assertTrue("Slot 1 is white", booster.get(0).getColor(null).isWhite());
|
||||
Assert.assertTrue("Slot 2 is white", booster.get(1).getColor(null).isWhite());
|
||||
Assert.assertTrue("Slot 1 is white", booster.get(0).getColor().isWhite());
|
||||
Assert.assertTrue("Slot 2 is white", booster.get(1).getColor().isWhite());
|
||||
|
||||
// Wretched Gryff is colorless, but stores in blue slots
|
||||
Assert.assertTrue("Slot 3 is blue", booster.get(2).getName().equals("Wretched Gryff") || booster.get(2).getColor(null).isBlue());
|
||||
Assert.assertTrue("Slot 4 is blue", booster.get(3).getName().equals("Wretched Gryff") || booster.get(3).getColor(null).isBlue());
|
||||
Assert.assertTrue("Slot 3 is blue", booster.get(2).getName().equals("Wretched Gryff") || booster.get(2).getColor().isBlue());
|
||||
Assert.assertTrue("Slot 4 is blue", booster.get(3).getName().equals("Wretched Gryff") || booster.get(3).getColor().isBlue());
|
||||
|
||||
Assert.assertTrue("Slot 5 is black", booster.get(4).getColor(null).isBlack());
|
||||
Assert.assertTrue("Slot 6 is black", booster.get(5).getColor(null).isBlack());
|
||||
Assert.assertTrue("Slot 5 is black", booster.get(4).getColor().isBlack());
|
||||
Assert.assertTrue("Slot 6 is black", booster.get(5).getColor().isBlack());
|
||||
|
||||
Assert.assertTrue("Slot 7 is red", booster.get(6).getColor(null).isRed());
|
||||
Assert.assertTrue("Slot 8 is red", booster.get(7).getColor(null).isRed());
|
||||
Assert.assertTrue("Slot 7 is red", booster.get(6).getColor().isRed());
|
||||
Assert.assertTrue("Slot 8 is red", booster.get(7).getColor().isRed());
|
||||
|
||||
Assert.assertTrue("Slot 9 is green", booster.get(8).getColor(null).isGreen());
|
||||
Assert.assertTrue("Slot 10 is green", booster.get(9).getColor(null).isGreen());
|
||||
Assert.assertTrue("Slot 9 is green", booster.get(8).getColor().isGreen());
|
||||
Assert.assertTrue("Slot 10 is green", booster.get(9).getColor().isGreen());
|
||||
|
||||
Assert.assertTrue("Slot 11 is multicolored", booster.get(10).getColor(null).isMulticolored());
|
||||
Assert.assertTrue("Slot 12 is colorless", booster.get(11).getColor(null).isColorless());
|
||||
Assert.assertTrue("Slot 11 is multicolored", booster.get(10).getColor().isMulticolored());
|
||||
Assert.assertTrue("Slot 12 is colorless", booster.get(11).getColor().isColorless());
|
||||
|
||||
Assert.assertEquals("Slot 15 is from FMB1 set", "FMB1", booster.get(14).getExpansionSetCode());
|
||||
}
|
||||
|
|
@ -157,9 +156,9 @@ public class BoosterGenerationTest extends MageTestBase {
|
|||
Assert.assertTrue("Slot 11 is multicolored (" + booster.get(10).getName() + ')', booster.get(10).getColorIdentity().isMulticolored());
|
||||
Assert.assertTrue(
|
||||
"Slot 12 is colorless (" + booster.get(11).getName() + ')',
|
||||
booster.get(11).getColor(null).isColorless()
|
||||
|| booster.get(11).isLand(currentGame)
|
||||
|| booster.get(11).isArtifact(currentGame)
|
||||
booster.get(11).getColor().isColorless()
|
||||
|| booster.get(11).isLand()
|
||||
|| booster.get(11).isArtifact()
|
||||
);
|
||||
|
||||
Assert.assertEquals("Slot 15 is from FMB1 set", "FMB1", booster.get(14).getExpansionSetCode());
|
||||
|
|
@ -202,11 +201,11 @@ public class BoosterGenerationTest extends MageTestBase {
|
|||
for (int i = 0; i < 50; i++) {
|
||||
List<Card> booster = CoreSet2019.getInstance().createBooster();
|
||||
// check that booster contains a land card
|
||||
assertTrue(booster.stream().anyMatch(card -> card.getCardType(currentGame).contains(CardType.LAND)));
|
||||
assertTrue(booster.stream().anyMatch(card -> card.isLand()));
|
||||
allCards.addAll(booster);
|
||||
}
|
||||
// check that some dual lands were generated
|
||||
assertTrue(allCards.stream().anyMatch(card -> card.getCardType(currentGame).contains(CardType.LAND) && Objects.equals(card.getRarity(), Rarity.COMMON)));
|
||||
assertTrue(allCards.stream().anyMatch(card -> card.isLand() && Objects.equals(card.getRarity(), Rarity.COMMON)));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -214,7 +213,7 @@ public class BoosterGenerationTest extends MageTestBase {
|
|||
for (int i = 0; i < 10; i++) {
|
||||
List<Card> booster = WarOfTheSpark.getInstance().createBooster();
|
||||
// check that booster contains a planeswalker
|
||||
assertTrue(booster.stream().anyMatch(card -> card.isPlaneswalker(currentGame)));
|
||||
assertTrue(booster.stream().anyMatch(MageObject::isPlaneswalker));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -223,7 +222,7 @@ public class BoosterGenerationTest extends MageTestBase {
|
|||
for (int i = 0; i < 10; i++) {
|
||||
List<Card> booster = Dominaria.getInstance().createBooster();
|
||||
// check that booster contains legendary creature
|
||||
assertTrue(booster.stream().anyMatch(card -> card.isCreature(currentGame) && card.isLegendary()));
|
||||
assertTrue(booster.stream().anyMatch(card -> card.isCreature() && card.isLegendary()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -247,7 +246,7 @@ public class BoosterGenerationTest extends MageTestBase {
|
|||
public void testBattlebond_BoosterMustHaveOneLand() {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
List<Card> booster = Battlebond.getInstance().createBooster();
|
||||
assertTrue("battlebond's booster must contain 1 land", booster.stream().anyMatch(card -> card.isBasic() && card.isLand(currentGame)));
|
||||
assertTrue("battlebond's booster must contain 1 land", booster.stream().anyMatch(card -> card.isBasic() && card.isLand()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -347,7 +346,7 @@ public class BoosterGenerationTest extends MageTestBase {
|
|||
booster.stream().map(Card::getRarity).filter(Rarity.UNCOMMON::equals).count()
|
||||
);
|
||||
|
||||
List<Card> snowLands = booster.stream().filter(card -> card.isSnow() && card.isLand(currentGame)).collect(Collectors.toList());
|
||||
List<Card> snowLands = booster.stream().filter(card -> card.isSnow() && card.isLand()).collect(Collectors.toList());
|
||||
switch (snowLands.size()) {
|
||||
case 0:
|
||||
fail("Booster must have snow lands");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue