forked from External/mage
loop to streams
This commit is contained in:
parent
6eba170e3c
commit
a167122459
10 changed files with 38 additions and 81 deletions
|
|
@ -18,11 +18,7 @@ public class DiscardCostCardConvertedMana implements DynamicValue {
|
|||
for (Cost cost : sourceAbility.getCosts()) {
|
||||
if (cost instanceof DiscardTargetCost) {
|
||||
DiscardTargetCost discardCost = (DiscardTargetCost) cost;
|
||||
int cmc = 0;
|
||||
for (Card card : discardCost.getCards()) {
|
||||
cmc += card.getConvertedManaCost();
|
||||
}
|
||||
return cmc;
|
||||
return discardCost.getCards().stream().mapToInt(Card::getConvertedManaCost).sum();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue