removed string constructor in SuperTypePredicate

This commit is contained in:
ingmargoudt 2017-04-09 10:50:31 +02:00
parent 8b44327312
commit 813d84274a
87 changed files with 265 additions and 224 deletions

View file

@ -27,7 +27,6 @@
*/
package mage.abilities.effects.common;
import java.util.UUID;
import mage.MageObject;
import mage.MageObjectReference;
import mage.abilities.Ability;
@ -40,6 +39,8 @@ import mage.game.permanent.PermanentCard;
import mage.game.permanent.PermanentToken;
import mage.util.functions.ApplyToPermanent;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
@ -130,7 +131,7 @@ public class CopyEffect extends ContinuousEffectImpl {
}
permanent.getSuperType().clear();
for (SuperType type : copyFromObject.getSuperType()) {
permanent.getSuperType().add(type);
permanent.addSuperType(type);
}
permanent.removeAllAbilities(source.getSourceId(), game);

View file

@ -36,7 +36,7 @@ public class CopyTokenEffect extends ContinuousEffectImpl {
}
permanent.getSuperType().clear();
for (SuperType type: token.getSuperType()) {
permanent.getSuperType().add(type);
permanent.addSuperType(type);
}
permanent.getAbilities().clear();
for (Ability ability: token.getAbilities()) {

View file

@ -85,7 +85,7 @@ public class TransformAbility extends SimpleStaticAbility {
}
permanent.getSuperType().clear();
for (SuperType type : sourceCard.getSuperType()) {
permanent.getSuperType().add(type);
permanent.addSuperType(type);
}
permanent.setExpansionSetCode(sourceCard.getExpansionSetCode());
permanent.getAbilities().clear();

View file

@ -44,10 +44,6 @@ public class SupertypePredicate implements Predicate<MageObject> {
this.supertype = supertype;
}
public SupertypePredicate(String supertype){
this.supertype = SuperType.valueOf(supertype.trim().toUpperCase());
}
@Override
public boolean apply(MageObject input, Game game) {
return input.getSuperType().contains(supertype);

View file

@ -101,7 +101,7 @@ public class CopyTokenFunction implements Function<Token, Card> {
}
target.getSuperType().clear();
for (SuperType type : sourceObj.getSuperType()) {
target.getSuperType().add(type);
target.addSuperType(type);
}
target.getAbilities().clear();