mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
minor cleanup to ManaPool
This commit is contained in:
parent
c55be4b7c8
commit
5376e81d90
2 changed files with 3 additions and 12 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue