foul-magics/Mage/src/main/java/mage/abilities/effects/RestrictionUntapNotMoreThanEffect.java
Susucre f75b1c9f0a
Code cleanup: protect all copy constructors (#10750)
* apply regex to change public copy constructors to protected
* cleanup code using now protected constructors
* fix manaBuilder weird casting of Mana into ConditionalMana
2023-08-04 19:34:58 -04:00

51 lines
1.3 KiB
Java

package mage.abilities.effects;
import mage.abilities.Ability;
import mage.constants.Duration;
import mage.constants.EffectType;
import mage.constants.Outcome;
import mage.filter.common.FilterControlledPermanent;
import mage.game.Game;
import mage.players.Player;
/**
* @author LevelX2
*/
public abstract class RestrictionUntapNotMoreThanEffect extends ContinuousEffectImpl {
private final int number;
private FilterControlledPermanent filter;
public RestrictionUntapNotMoreThanEffect(Duration duration, int number, FilterControlledPermanent filter) {
super(duration, Outcome.Detriment);
this.effectType = EffectType.RESTRICTION_UNTAP_NOT_MORE_THAN;
this.number = number;
this.filter = filter;
}
protected RestrictionUntapNotMoreThanEffect(final RestrictionUntapNotMoreThanEffect effect) {
super(effect);
this.number = effect.number;
if (effect.filter != null) {
this.filter = effect.filter.copy();
}
}
@Override
public boolean apply(Game game, Ability source) {
throw new UnsupportedOperationException("Not supported.");
}
public abstract boolean applies(Player player, Ability source, Game game);
public int getNumber() {
return number;
}
public FilterControlledPermanent getFilter() {
return filter;
}
}