Fixed import (compilation error fix)

This commit is contained in:
magenoxx 2011-09-16 10:55:02 +04:00
parent b81992bf9d
commit 925e879fb0

View file

@ -28,7 +28,6 @@
package mage.abilities.decorator; package mage.abilities.decorator;
import com.sun.istack.internal.Nullable;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
@ -36,48 +35,48 @@ import mage.game.Game;
/** /**
* Adds condition to {@link OneShotEffect}. Acts as decorator. * Adds condition to {@link OneShotEffect}. Acts as decorator.
* *
* @author maurer.it_at_gmail.com * @author maurer.it_at_gmail.com
*/ */
public class ConditionalOneShotEffect extends OneShotEffect<ConditionalOneShotEffect> { public class ConditionalOneShotEffect extends OneShotEffect<ConditionalOneShotEffect> {
private OneShotEffect effect; private OneShotEffect effect;
private OneShotEffect otherwiseEffect; private OneShotEffect otherwiseEffect;
private Condition condition; private Condition condition;
public ConditionalOneShotEffect ( OneShotEffect effect, Condition condition, String text ) { public ConditionalOneShotEffect(OneShotEffect effect, Condition condition, String text) {
this(effect, null, condition, text); this(effect, null, condition, text);
} }
public ConditionalOneShotEffect ( OneShotEffect effect, OneShotEffect otherwiseEffect, Condition condition, String text ) { public ConditionalOneShotEffect(OneShotEffect effect, OneShotEffect otherwiseEffect, Condition condition, String text) {
super(effect.getOutcome()); super(effect.getOutcome());
this.effect = effect; this.effect = effect;
this.otherwiseEffect = otherwiseEffect; this.otherwiseEffect = otherwiseEffect;
this.condition = condition; this.condition = condition;
this.staticText = text; this.staticText = text;
} }
public ConditionalOneShotEffect ( ConditionalOneShotEffect effect ) { public ConditionalOneShotEffect(ConditionalOneShotEffect effect) {
super(effect); super(effect);
this.effect = (OneShotEffect) effect.effect.copy(); this.effect = (OneShotEffect) effect.effect.copy();
if (effect.otherwiseEffect != null) if (effect.otherwiseEffect != null)
this.otherwiseEffect = (OneShotEffect) effect.otherwiseEffect.copy(); this.otherwiseEffect = (OneShotEffect) effect.otherwiseEffect.copy();
this.condition = effect.condition; this.condition = effect.condition;
} }
@Override @Override
public boolean apply ( Game game, Ability source ) { public boolean apply(Game game, Ability source) {
if ( condition.apply(game, source) ) { if (condition.apply(game, source)) {
return effect.apply(game, source); return effect.apply(game, source);
} else if (otherwiseEffect != null) { } else if (otherwiseEffect != null) {
return otherwiseEffect.apply(game, source); return otherwiseEffect.apply(game, source);
} }
return false; return false;
} }
@Override @Override
public ConditionalOneShotEffect copy ( ) { public ConditionalOneShotEffect copy() {
return new ConditionalOneShotEffect ( this ); return new ConditionalOneShotEffect(this);
} }
} }