Refactor - moved ZuberasDiedDynamicValue to shared area

This commit is contained in:
JOAC69 2016-09-24 23:50:08 -05:00
parent 8e6389040d
commit b17b5c9e1a
5 changed files with 39 additions and 27 deletions

View file

@ -30,6 +30,7 @@ package mage.sets.championsofkamigawa;
import java.util.UUID;
import mage.abilities.dynamicvalue.common.ZuberasDiedDynamicValue;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.MageInt;

View file

@ -29,6 +29,8 @@
package mage.sets.championsofkamigawa;
import java.util.UUID;
import mage.abilities.dynamicvalue.common.ZuberasDiedDynamicValue;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.MageInt;

View file

@ -30,6 +30,7 @@ package mage.sets.championsofkamigawa;
import java.util.UUID;
import mage.abilities.dynamicvalue.common.ZuberasDiedDynamicValue;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.MageInt;

View file

@ -29,15 +29,12 @@
package mage.sets.championsofkamigawa;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.dynamicvalue.common.ZuberasDiedDynamicValue;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.game.Game;
import mage.watchers.common.ZuberasDiedWatcher;
import java.util.UUID;
@ -70,26 +67,3 @@ public class FloatingDreamZubera extends CardImpl {
}
class ZuberasDiedDynamicValue implements DynamicValue {
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
ZuberasDiedWatcher watcher = (ZuberasDiedWatcher) game.getState().getWatchers().get("ZuberasDied");
return watcher.zuberasDiedThisTurn;
}
@Override
public ZuberasDiedDynamicValue copy() {
return new ZuberasDiedDynamicValue();
}
@Override
public String toString() {
return "1";
}
@Override
public String getMessage() {
return "Zubera that died this turn";
}
}

View file

@ -0,0 +1,34 @@
package mage.abilities.dynamicvalue.common;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.game.Game;
import mage.watchers.common.ZuberasDiedWatcher;
/**
* Created by Eric on 9/24/2016.
*/
public class ZuberasDiedDynamicValue implements DynamicValue {
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
ZuberasDiedWatcher watcher = (ZuberasDiedWatcher) game.getState().getWatchers().get("ZuberasDied");
return watcher.zuberasDiedThisTurn;
}
@Override
public ZuberasDiedDynamicValue copy() {
return new ZuberasDiedDynamicValue();
}
@Override
public String toString() {
return "1";
}
@Override
public String getMessage() {
return "Zubera that died this turn";
}
}