Remove an unused and functionally duplicated Filter class

This commit is contained in:
Alex W. Jackson 2022-01-06 03:51:46 -05:00
parent 76a61b0bef
commit f1ff4dbd0e

View file

@ -1,64 +0,0 @@
package mage.filter.common;
import java.util.UUID;
import mage.constants.TargetController;
import mage.filter.FilterImpl;
import mage.filter.FilterInPlay;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
* @author jeffwadsworth
*/
public class FilterControlledCreatureInPlay extends FilterImpl<Object> implements FilterInPlay<Object> {
protected final FilterCreaturePermanent creatureFilter;
public FilterControlledCreatureInPlay() {
this("creature");
}
public FilterControlledCreatureInPlay(String name) {
super(name);
creatureFilter = new FilterCreaturePermanent();
creatureFilter.add(TargetController.YOU.getControllerPredicate());
}
@Override
public boolean checkObjectClass(Object object) {
return object instanceof Permanent;
}
public FilterControlledCreatureInPlay(final FilterControlledCreatureInPlay filter) {
super(filter);
this.creatureFilter = filter.creatureFilter.copy();
}
@Override
public boolean match(Object o, Game game) {
if (o instanceof Permanent) {
return creatureFilter.match((Permanent) o, game);
}
return false;
}
@Override
public boolean match(Object o, UUID sourceId, UUID playerId, Game game) {
if (o instanceof Permanent) {
return creatureFilter.match((Permanent) o, sourceId, playerId, game);
}
return false;
}
public FilterCreaturePermanent getCreatureFilter() {
return this.creatureFilter;
}
@Override
public FilterControlledCreatureInPlay copy() {
return new FilterControlledCreatureInPlay(this);
}
}