refactor: replacement effects don't use apply method now (#11484)

This commit is contained in:
xenohedron 2023-11-28 02:17:28 -05:00 committed by GitHub
parent 8ad3238109
commit 05e2cf11e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
275 changed files with 171 additions and 1545 deletions

View file

@ -1,4 +1,3 @@
package mage.abilities.effects;
import mage.abilities.Ability;
@ -24,7 +23,7 @@ public abstract class ReplacementEffectImpl extends ContinuousEffectImpl impleme
// continuous effects from any other source that would affect it.
protected boolean selfScope;
public ReplacementEffectImpl(Duration duration, Outcome outcome) {
protected ReplacementEffectImpl(Duration duration, Outcome outcome) {
this(duration, outcome, true);
}
@ -34,7 +33,7 @@ public abstract class ReplacementEffectImpl extends ContinuousEffectImpl impleme
* @param selfScope - is only relevant while permanents entering the
* battlefield events
*/
public ReplacementEffectImpl(Duration duration, Outcome outcome, boolean selfScope) {
protected ReplacementEffectImpl(Duration duration, Outcome outcome, boolean selfScope) {
super(duration, outcome);
this.effectType = EffectType.REPLACEMENT;
this.selfScope = selfScope;
@ -51,8 +50,8 @@ public abstract class ReplacementEffectImpl extends ContinuousEffectImpl impleme
}
@Override
public boolean apply(Game game, Ability source) {
throw new UnsupportedOperationException("Not used for replacemnt effect.");
public final boolean apply(Game game, Ability source) {
throw new UnsupportedOperationException("Wrong code usage: apply() not used for replacement effect.");
}
}