forked from External/mage
Removed old AlternativeCost class, that's no longer used in cards.
This commit is contained in:
parent
29b37b046d
commit
19d67f9a83
8 changed files with 47 additions and 257 deletions
|
|
@ -1,44 +0,0 @@
|
|||
package mage.abilities.costs;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.game.Game;
|
||||
|
||||
public class AlternativeCostImpl<T extends Cost> extends CostsImpl<T> implements AlternativeCost {
|
||||
|
||||
protected String name;
|
||||
|
||||
public AlternativeCostImpl(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public AlternativeCostImpl(String name, Cost cost) {
|
||||
this.name = name;
|
||||
this.add((T)cost);
|
||||
}
|
||||
|
||||
public AlternativeCostImpl(final AlternativeCostImpl cost) {
|
||||
super(cost);
|
||||
this.name = cost.name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAvailable(Game game, Ability source) {
|
||||
for (int x=0; x < ((Costs) this).size(); x++) {
|
||||
Cost cost = (Cost) ((Costs) this).get(x);
|
||||
if (!cost.canPay(source, source.getSourceId(), source.getControllerId(), game)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AlternativeCostImpl copy() {
|
||||
return new AlternativeCostImpl(this);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue