Removed old AlternativeCost class, that's no longer used in cards.

This commit is contained in:
LevelX2 2016-03-06 22:32:58 +01:00
parent 29b37b046d
commit 19d67f9a83
8 changed files with 47 additions and 257 deletions

View file

@ -34,7 +34,6 @@ import mage.MageObject;
import mage.MageObjectReference;
import mage.Mana;
import mage.abilities.costs.AdjustingSourceCosts;
import mage.abilities.costs.AlternativeCost;
import mage.abilities.costs.AlternativeSourceCosts;
import mage.abilities.costs.Cost;
import mage.abilities.costs.Costs;
@ -97,7 +96,6 @@ public abstract class AbilityImpl implements Ability {
protected ManaCosts<ManaCost> manaCosts;
protected ManaCosts<ManaCost> manaCostsToPay;
protected Costs<Cost> costs;
protected ArrayList<AlternativeCost> alternativeCosts = new ArrayList<>();
protected Costs<Cost> optionalCosts;
protected Modes modes;
protected Zone zone;
@ -141,9 +139,6 @@ public abstract class AbilityImpl implements Ability {
this.manaCostsToPay = ability.manaCostsToPay.copy();
this.costs = ability.costs.copy();
this.optionalCosts = ability.optionalCosts.copy();
for (AlternativeCost cost : ability.alternativeCosts) {
this.alternativeCosts.add((AlternativeCost) cost.copy());
}
if (ability.watchers != null) {
this.watchers = new ArrayList<>();
for (Watcher watcher : ability.watchers) {
@ -398,12 +393,9 @@ public abstract class AbilityImpl implements Ability {
activatorId = ((ActivatedAbilityImpl) this).getActivatorId();
}
if (!useAlternativeCost(game)) { // old way still used?
//20100716 - 601.2f (noMana is not used here, because mana costs were cleared for this ability before adding additional costs and applying cost modification effects)
if (!manaCostsToPay.pay(this, game, sourceId, activatorId, false, null)) {
return false; // cancel during mana payment
}
//20100716 - 601.2f (noMana is not used here, because mana costs were cleared for this ability before adding additional costs and applying cost modification effects)
if (!manaCostsToPay.pay(this, game, sourceId, activatorId, false, null)) {
return false; // cancel during mana payment
}
//20100716 - 601.2g
@ -593,18 +585,6 @@ public abstract class AbilityImpl implements Ability {
public void reset(Game game) {
}
// Is this still needed?
protected boolean useAlternativeCost(Game game) {
for (AlternativeCost cost : alternativeCosts) {
if (cost.isAvailable(game, this)) {
if (game.getPlayer(this.controllerId).chooseUse(Outcome.Neutral, "Use alternative cost " + cost.getName(), this, game)) {
return cost.pay(this, game, sourceId, controllerId, false, null);
}
}
}
return false;
}
@Override
public boolean checkIfClause(Game game) {
return true;
@ -676,11 +656,6 @@ public abstract class AbilityImpl implements Ability {
return manaCostsToPay;
}
@Override
public List<AlternativeCost> getAlternativeCosts() {
return alternativeCosts;
}
@Override
public Costs<Cost> getOptionalCosts() {
return optionalCosts;
@ -843,13 +818,6 @@ public abstract class AbilityImpl implements Ability {
}
}
@Override
public void addAlternativeCost(AlternativeCost cost) {
if (cost != null) {
this.alternativeCosts.add(cost);
}
}
@Override
public void addOptionalCost(Cost cost) {
if (cost != null) {