mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
Updated some targets and filters
This commit is contained in:
parent
56777cb0d0
commit
4e3961a819
10 changed files with 28 additions and 33 deletions
|
|
@ -66,7 +66,7 @@ public class FilterCard extends FilterObject<Card> {
|
|||
return Predicates.and(extraPredicates).apply(new ObjectSourcePlayer(card, sourceId, playerId), game);
|
||||
}
|
||||
|
||||
public void add(ObjectPlayerPredicate predicate) {
|
||||
public final void add(ObjectPlayerPredicate predicate) {
|
||||
if (isLockedFilter()) {
|
||||
throw new UnsupportedOperationException("You may not modify a locked filter");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public abstract class FilterImpl<E> implements Filter<E> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setMessage(String message) {
|
||||
public final void setMessage(String message) {
|
||||
if (isLockedFilter()) {
|
||||
throw new UnsupportedOperationException("You may not modify a locked filter");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class FilterPermanent extends FilterObject<Permanent> implements FilterIn
|
|||
return Predicates.and(extraPredicates).apply(new ObjectSourcePlayer(permanent, sourceId, playerId), game);
|
||||
}
|
||||
|
||||
public void add(ObjectPlayerPredicate predicate) {
|
||||
public final void add(ObjectPlayerPredicate predicate) {
|
||||
if (isLockedFilter()) {
|
||||
throw new UnsupportedOperationException("You may not modify a locked filter");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ public class FilterStackObject extends FilterObject<StackObject> {
|
|||
protected List<ObjectPlayerPredicate<ObjectPlayer<Permanent>>> extraPredicates = new ArrayList<>();
|
||||
|
||||
public FilterStackObject() {
|
||||
super("spell or ability");
|
||||
this("spell or ability");
|
||||
}
|
||||
|
||||
public FilterStackObject(String name) {
|
||||
|
|
@ -40,7 +40,7 @@ public class FilterStackObject extends FilterObject<StackObject> {
|
|||
return Predicates.and(extraPredicates).apply(new ObjectSourcePlayer(stackObject, sourceId, playerId), game);
|
||||
}
|
||||
|
||||
public void add(ObjectPlayerPredicate predicate) {
|
||||
public final void add(ObjectPlayerPredicate predicate) {
|
||||
if (isLockedFilter()) {
|
||||
throw new UnsupportedOperationException("You may not modify a locked filter");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.target;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
|
@ -8,6 +7,7 @@ import mage.MageObject;
|
|||
import mage.abilities.Ability;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
|
|
@ -20,11 +20,11 @@ public class TargetPermanent extends TargetObject {
|
|||
protected FilterPermanent filter;
|
||||
|
||||
public TargetPermanent() {
|
||||
this(1, 1, new FilterPermanent(), false);
|
||||
this(StaticFilters.FILTER_PERMANENT);
|
||||
}
|
||||
|
||||
public TargetPermanent(FilterPermanent filter) {
|
||||
this(1, 1, filter, false);
|
||||
this(1, filter);
|
||||
}
|
||||
|
||||
public TargetPermanent(int numTargets, FilterPermanent filter) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
package mage.target.common;
|
||||
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -10,19 +10,19 @@ import mage.filter.common.FilterControlledCreaturePermanent;
|
|||
public class TargetControlledCreaturePermanent extends TargetControlledPermanent {
|
||||
|
||||
public TargetControlledCreaturePermanent() {
|
||||
this(1, 1, new FilterControlledCreaturePermanent(), false);
|
||||
this(1);
|
||||
}
|
||||
|
||||
public TargetControlledCreaturePermanent(int numTargets) {
|
||||
this(numTargets, numTargets, new FilterControlledCreaturePermanent(), false);
|
||||
this(numTargets, numTargets);
|
||||
}
|
||||
|
||||
public TargetControlledCreaturePermanent(int minNumTargets, int maxNumTargets) {
|
||||
this(minNumTargets, maxNumTargets, new FilterControlledCreaturePermanent(), false);
|
||||
this(minNumTargets, maxNumTargets, StaticFilters.FILTER_CONTROLLED_CREATURE, false);
|
||||
}
|
||||
|
||||
public TargetControlledCreaturePermanent(FilterControlledCreaturePermanent filter) {
|
||||
super(1, 1, filter, false);
|
||||
this(1, 1, filter, false);
|
||||
}
|
||||
|
||||
public TargetControlledCreaturePermanent(int minNumTargets, int maxNumTargets, FilterControlledCreaturePermanent filter, boolean notTarget) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
|
||||
|
||||
package mage.target.common;
|
||||
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
|
|
@ -12,11 +11,11 @@ import mage.target.TargetPermanent;
|
|||
public class TargetControlledPermanent extends TargetPermanent {
|
||||
|
||||
public TargetControlledPermanent() {
|
||||
this(1, 1, new FilterControlledPermanent(), false);
|
||||
this(1, 1, StaticFilters.FILTER_CONTROLLED_PERMANENT, false);
|
||||
}
|
||||
|
||||
public TargetControlledPermanent(int numTargets) {
|
||||
this(numTargets, numTargets, new FilterControlledPermanent(), false);
|
||||
this(numTargets, numTargets, StaticFilters.FILTER_CONTROLLED_PERMANENT, false);
|
||||
}
|
||||
|
||||
public TargetControlledPermanent(FilterControlledPermanent filter) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue