minor cleanup to ManaPool

This commit is contained in:
xenohedron 2024-01-07 03:55:28 -05:00
parent c55be4b7c8
commit 5376e81d90
2 changed files with 3 additions and 12 deletions

View file

@ -292,7 +292,7 @@ public class ManaCostsImpl<T extends ManaCost> extends ArrayList<T> implements M
private boolean canPayColoredManaFromPool(ManaType needColor, ManaCost cost, ManaType canUseManaType, ManaPool pool) {
if (canUseManaType == null || canUseManaType.equals(needColor)) {
return cost.containsColor(CardUtil.manaTypeToColoredManaSymbol(needColor))
&& (pool.getColoredAmount(needColor) > 0 || pool.ConditionalManaHasManaType(needColor));
&& (pool.getColoredAmount(needColor) > 0 || pool.conditionalManaHasManaType(needColor));
}
return false;
}

View file

@ -196,8 +196,7 @@ public class ManaPool implements Serializable {
}
}
if (manaTypeToUse != null && mana.getConditionalMana().apply(ability, game, mana.getSourceId(), costToPay)) {
if (filter == null
|| filter.match(mana.getSourceObject(), game)) {
if (filter == null || filter.match(mana.getSourceObject(), game)) {
return new ConditionalManaInfo(manaTypeToUse, mana.getSourceObject());
}
}
@ -239,18 +238,10 @@ public class ManaPool implements Serializable {
this.manaBecomesBlack = manaBecomesBlack;
}
public boolean isManaBecomesBlack() {
return manaBecomesBlack;
}
public void setManaBecomesColorless(boolean manaBecomesColorless) {
this.manaBecomesColorless = manaBecomesColorless;
}
public boolean isManaBecomesColorless() {
return manaBecomesColorless;
}
public void init() {
manaItems.clear();
}
@ -393,7 +384,7 @@ public class ManaPool implements Serializable {
return conditionalMana;
}
public boolean ConditionalManaHasManaType(ManaType manaType) {
public boolean conditionalManaHasManaType(ManaType manaType) {
for (ManaPoolItem item : manaItems) {
if (item.isConditional()) {
if (item.getConditionalMana().get(manaType) > 0) {