Add Subtype to the CardAttribute Framework

This is a massive change. I’ve refrained from unrelated refactoring
when possible but there are still a lot of changes here.
This commit is contained in:
Samuel Sandeen 2016-08-28 17:30:10 -04:00
parent a1a3c0c6a7
commit 282443c231
272 changed files with 514 additions and 493 deletions

View file

@ -48,7 +48,7 @@ public class LazavDimirMastermindTest extends CardTestPlayerBase {
assertPowerToughness(playerA, "Lazav, Dimir Mastermind", 3, 2);
Permanent lazav = getPermanent("Lazav, Dimir Mastermind", playerA.getId());
Assert.assertTrue(lazav.getSubtype().contains("Griffin"));
Assert.assertTrue(lazav.getSubtype(currentGame).contains("Griffin"));
Assert.assertTrue("Lazav, Dimir Mastermind must have flying",lazav.getAbilities().contains(FlyingAbility.getInstance()));
}
@ -74,8 +74,8 @@ public class LazavDimirMastermindTest extends CardTestPlayerBase {
assertPermanentCount(playerA, "Lazav, Dimir Mastermind", 1);
assertPowerToughness(playerA, "Lazav, Dimir Mastermind", 3, 3);
Permanent lazav = getPermanent("Lazav, Dimir Mastermind", playerA.getId());
Assert.assertTrue(lazav.getSubtype().contains("Ogre"));
Assert.assertTrue(lazav.getSubtype().contains("Rogue"));
Assert.assertTrue(lazav.getSubtype(currentGame).contains("Ogre"));
Assert.assertTrue(lazav.getSubtype(currentGame).contains("Rogue"));
Permanent gutterSkulk = getPermanent("Gutter Skulk", playerA.getId());
Assert.assertTrue("Gutter Skulk should have deathtouch but hasn't", gutterSkulk.getAbilities().contains(DeathtouchAbility.getInstance()));
@ -116,7 +116,7 @@ public class LazavDimirMastermindTest extends CardTestPlayerBase {
Permanent lazav = getPermanent("Lazav, Dimir Mastermind", playerA.getId());
Assert.assertTrue(lazav.getAbilities().contains(FlyingAbility.getInstance()));
Assert.assertTrue(lazav.getSubtype().contains("Specter"));
Assert.assertTrue(lazav.getSubtype(currentGame).contains("Specter"));
Assert.assertTrue(lazav.getSupertype().contains("Legendary"));
assertPermanentCount(playerA, "Silvercoat Lion", 1);
@ -146,7 +146,7 @@ public class LazavDimirMastermindTest extends CardTestPlayerBase {
assertPowerToughness(playerA, "Lazav, Dimir Mastermind", 2, 2);
Permanent lazav = getPermanent("Lazav, Dimir Mastermind", playerA.getId());
Assert.assertTrue(lazav.getSubtype().contains("Cat"));
Assert.assertTrue(lazav.getSubtype(currentGame).contains("Cat"));
Assert.assertTrue(lazav.getSupertype().contains("Legendary"));
}
@ -190,7 +190,7 @@ public class LazavDimirMastermindTest extends CardTestPlayerBase {
assertPermanentCount(playerA, "Lazav, Dimir Mastermind", 1);
assertPowerToughness(playerA, "Lazav, Dimir Mastermind", 3, 3);
Permanent lazav = getPermanent("Lazav, Dimir Mastermind", playerA.getId());
Assert.assertFalse(lazav.getSubtype().contains("Griffin")); // no Griffin type
Assert.assertFalse(lazav.getSubtype(currentGame).contains("Griffin")); // no Griffin type
Assert.assertFalse("Lazav, Dimir Mastermind must have flying",lazav.getAbilities().contains(FlyingAbility.getInstance()));
@ -226,7 +226,7 @@ public class LazavDimirMastermindTest extends CardTestPlayerBase {
assertPowerToughness(playerA, "Lazav, Dimir Mastermind", 3, 2);
Permanent lazav = getPermanent("Lazav, Dimir Mastermind", playerA.getId());
Assert.assertTrue(lazav.getSubtype().contains("Griffin"));
Assert.assertTrue(lazav.getSubtype(currentGame).contains("Griffin"));
Assert.assertTrue("Lazav, Dimir Mastermind must have flying",lazav.getAbilities().contains(FlyingAbility.getInstance()));
}
}

View file

@ -43,7 +43,7 @@ public class VolrathsShapshifterTest extends CardTestPlayerBase {
assertPowerToughness(playerA, "Assault Griffin", 3, 2);
Permanent shapeshifter = getPermanent("Assault Griffin", playerA.getId());
Assert.assertTrue(shapeshifter.getSubtype().contains("Griffin"));
Assert.assertTrue(shapeshifter.getSubtype(currentGame).contains("Griffin"));
Assert.assertTrue("Volrath's Shapeshifter must have flying", shapeshifter.getAbilities().contains(FlyingAbility.getInstance()));
Assert.assertTrue("Volrath's Shapeshifter must have {2} : Discard a card", hasShapeshiftersOriginalAbility(shapeshifter));
}
@ -73,7 +73,7 @@ public class VolrathsShapshifterTest extends CardTestPlayerBase {
assertPowerToughness(playerA, "Volrath's Shapeshifter", 0, 1);
Permanent shapeshifter = getPermanent("Volrath's Shapeshifter", playerA.getId());
Assert.assertTrue(shapeshifter.getSubtype().contains("Shapeshifter"));
Assert.assertTrue(shapeshifter.getSubtype(currentGame).contains("Shapeshifter"));
Assert.assertTrue("Volrath's Shapeshifter must have {2} : Discard a card", hasShapeshiftersOriginalAbility(shapeshifter));
}
@ -100,7 +100,7 @@ public class VolrathsShapshifterTest extends CardTestPlayerBase {
assertPowerToughness(playerA, "Dutiful Thrull", 1, 1);
Permanent shapeshifter = getPermanent("Dutiful Thrull", playerA.getId());
Assert.assertTrue(shapeshifter.getSubtype().contains("Thrull"));
Assert.assertTrue(shapeshifter.getSubtype(currentGame).contains("Thrull"));
Assert.assertTrue("Volrath's Shapeshifter must have {2} : Discard a card", hasShapeshiftersOriginalAbility(shapeshifter));

View file

@ -70,7 +70,7 @@ public class LignifyTest extends CardTestPlayerBase {
Permanent hivelord = getPermanent("Sliver Hivelord", playerB);
Assert.assertFalse("Sliver Hivelord may not be of subtype Sliver", hivelord.getSubtype().contains("Sliver"));
Assert.assertFalse("Sliver Hivelord may not be of subtype Sliver", hivelord.getSubtype(currentGame).contains("Sliver"));
}

View file

@ -40,7 +40,7 @@ public class SoulSeparatorTest extends CardTestPlayerBase {
Permanent saToken = getPermanent("Sylvan Advocate", playerA);
Assert.assertTrue(saToken.getAbilities().contains(FlyingAbility.getInstance()));
Assert.assertTrue(saToken.getSubtype().contains("Spirit"));
Assert.assertTrue(saToken.getSubtype(currentGame).contains("Spirit"));
Assert.assertTrue(saToken.getAbilities().contains(VigilanceAbility.getInstance()));
assertPowerToughness(playerA, "Sylvan Advocate", 1, 1);
}
@ -76,7 +76,7 @@ public class SoulSeparatorTest extends CardTestPlayerBase {
Permanent treeToken = getPermanent("Tree of Perdition", playerA);
Assert.assertTrue(treeToken.getAbilities().contains(FlyingAbility.getInstance()));
Assert.assertTrue(treeToken.getSubtype().contains("Spirit"));
Assert.assertTrue(treeToken.getSubtype(currentGame).contains("Spirit"));
Assert.assertTrue(treeToken.getAbilities().contains(DefenderAbility.getInstance()));
assertLife(playerA, 20);

View file

@ -60,7 +60,7 @@ public class FathomMageTest extends CardTestPlayerBase {
assertPowerToughness(playerA, "Fathom Mage", 3, 3);
Permanent fathomMage = getPermanent("Fathom Mage", playerA);
Assert.assertEquals("Fathom Mage has to be a Mutant", true, fathomMage.getSubtype().contains("Mutant"));
Assert.assertEquals("Fathom Mage has to be a Mutant", true, fathomMage.getSubtype(currentGame).contains("Mutant"));
assertHandCount(playerA, 2);
}

View file

@ -716,7 +716,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
Assert.assertTrue("(Battlefield) card type not found (" + cardName + ":" + type + ")", found.getCardType().contains(type));
Assert.assertTrue("(Battlefield) card sub-type not equal (" + cardName + ":" + subType + ")", found.getSubtype().contains(subType));
Assert.assertTrue("(Battlefield) card sub-type not equal (" + cardName + ":" + subType + ")", found.getSubtype(currentGame).contains(subType));
}
/**