forked from External/mage
[BRC] Implement Rootpath Purifier (ready for review) (#10363)
* refactor check supertype methods * change supertype to list to match card type * refactor various subtype methods * implement mageobjectattribute for supertype * a few fixes * [BRC] Implement Rootpath Purifier * a few extra fixes * more fixes * add test for purifier
This commit is contained in:
parent
a850e3660b
commit
024c3081df
98 changed files with 489 additions and 238 deletions
|
|
@ -15,7 +15,6 @@ import mage.constants.SubType;
|
|||
import mage.constants.SuperType;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.util.GameLog;
|
||||
import mage.util.SubTypes;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
|
@ -181,8 +180,8 @@ public class Commander extends CommandObjectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Set<SuperType> getSuperType() {
|
||||
return sourceObject.getSuperType();
|
||||
public List<SuperType> getSuperType(Game game) {
|
||||
return sourceObject.getSuperType(game);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ import mage.game.command.dungeons.TombOfAnnihilationDungeon;
|
|||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.players.Player;
|
||||
import mage.util.GameLog;
|
||||
import mage.util.SubTypes;
|
||||
|
||||
import java.util.*;
|
||||
|
|
@ -45,7 +44,7 @@ public class Dungeon extends CommandObjectImpl {
|
|||
dungeonNames.add("Dungeon of the Mad Mage");
|
||||
}
|
||||
|
||||
private static final List<CardType> emptyList = Collections.unmodifiableList(Arrays.asList(CardType.DUNGEON));
|
||||
private static final List<CardType> cardTypes = Collections.unmodifiableList(Arrays.asList(CardType.DUNGEON));
|
||||
private static final ObjectColor emptyColor = new ObjectColor();
|
||||
private static final ManaCosts<ManaCost> emptyCost = new ManaCostsImpl<>();
|
||||
|
||||
|
|
@ -204,7 +203,7 @@ public class Dungeon extends CommandObjectImpl {
|
|||
|
||||
@Override
|
||||
public List<CardType> getCardType(Game game) {
|
||||
return emptyList;
|
||||
return cardTypes;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -223,8 +222,8 @@ public class Dungeon extends CommandObjectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<SuperType> getSuperType() {
|
||||
return EnumSet.noneOf(SuperType.class);
|
||||
public List<SuperType> getSuperType(Game game) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import mage.abilities.costs.mana.ManaCosts;
|
|||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.FrameStyle;
|
||||
import mage.cards.repository.TokenInfo;
|
||||
import mage.cards.repository.TokenRepository;
|
||||
|
|
@ -20,19 +19,17 @@ import mage.constants.SubType;
|
|||
import mage.constants.SuperType;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.permanent.token.TokenImpl;
|
||||
import mage.util.GameLog;
|
||||
import mage.util.RandomUtil;
|
||||
import mage.util.SubTypes;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author nantuko
|
||||
*/
|
||||
public abstract class Emblem extends CommandObjectImpl {
|
||||
|
||||
private static final List<CardType> emptyList = Collections.unmodifiableList(new ArrayList<>());
|
||||
private static final ObjectColor emptyColor = new ObjectColor();
|
||||
private static final ManaCosts emptyCost = new ManaCostsImpl<>();
|
||||
|
||||
|
|
@ -121,7 +118,7 @@ public abstract class Emblem extends CommandObjectImpl {
|
|||
|
||||
@Override
|
||||
public List<CardType> getCardType(Game game) {
|
||||
return emptyList;
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -140,8 +137,8 @@ public abstract class Emblem extends CommandObjectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<SuperType> getSuperType() {
|
||||
return EnumSet.noneOf(SuperType.class);
|
||||
public List<SuperType> getSuperType(Game game) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import mage.abilities.costs.mana.ManaCosts;
|
|||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.FrameStyle;
|
||||
import mage.cards.repository.TokenInfo;
|
||||
import mage.cards.repository.TokenRepository;
|
||||
|
|
@ -21,19 +20,19 @@ import mage.constants.SubType;
|
|||
import mage.constants.SuperType;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.util.GameLog;
|
||||
import mage.util.RandomUtil;
|
||||
import mage.util.SubTypes;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.util.*;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author spjspj
|
||||
*/
|
||||
public abstract class Plane extends CommandObjectImpl {
|
||||
|
||||
private static final List<CardType> emptyList = Collections.unmodifiableList(new ArrayList<>());
|
||||
private static final ObjectColor emptyColor = new ObjectColor();
|
||||
private static final ManaCosts emptyCost = new ManaCostsImpl<>();
|
||||
|
||||
|
|
@ -144,7 +143,7 @@ public abstract class Plane extends CommandObjectImpl {
|
|||
|
||||
@Override
|
||||
public List<CardType> getCardType(Game game) {
|
||||
return emptyList;
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -163,8 +162,8 @@ public abstract class Plane extends CommandObjectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<SuperType> getSuperType() {
|
||||
return EnumSet.noneOf(SuperType.class);
|
||||
public List<SuperType> getSuperType(Game game) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ class TheRingEmblemLegendaryEffect extends ContinuousEffectImpl {
|
|||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
permanent.addSuperType(SuperType.LEGENDARY);
|
||||
permanent.addSuperType(game, SuperType.LEGENDARY);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue