use of mage.constants.ManaType in project mage by magefree.
the class ManaPool method emptyPool.
public int emptyPool(Game game) {
int total = 0;
Iterator<ManaPoolItem> it = manaItems.iterator();
while (it.hasNext()) {
ManaPoolItem item = it.next();
ConditionalMana conditionalItem = item.getConditionalMana();
for (ManaType manaType : ManaType.values()) {
if (doNotEmptyManaTypes.contains(manaType)) {
continue;
}
if (item.get(manaType) > 0) {
total += emptyItem(item, item, game, manaType);
}
if (conditionalItem != null && conditionalItem.get(manaType) > 0) {
total += emptyItem(item, conditionalItem, game, manaType);
}
}
if (item.count() == 0) {
it.remove();
}
}
return total;
}
Aggregations