mirror of
https://github.com/magefree/mage.git
synced 2026-01-24 04:09:54 -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) {
|
private boolean canPayColoredManaFromPool(ManaType needColor, ManaCost cost, ManaType canUseManaType, ManaPool pool) {
|
||||||
if (canUseManaType == null || canUseManaType.equals(needColor)) {
|
if (canUseManaType == null || canUseManaType.equals(needColor)) {
|
||||||
return cost.containsColor(CardUtil.manaTypeToColoredManaSymbol(needColor))
|
return cost.containsColor(CardUtil.manaTypeToColoredManaSymbol(needColor))
|
||||||
&& (pool.getColoredAmount(needColor) > 0 || pool.ConditionalManaHasManaType(needColor));
|
&& (pool.getColoredAmount(needColor) > 0 || pool.conditionalManaHasManaType(needColor));
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -196,8 +196,7 @@ public class ManaPool implements Serializable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (manaTypeToUse != null && mana.getConditionalMana().apply(ability, game, mana.getSourceId(), costToPay)) {
|
if (manaTypeToUse != null && mana.getConditionalMana().apply(ability, game, mana.getSourceId(), costToPay)) {
|
||||||
if (filter == null
|
if (filter == null || filter.match(mana.getSourceObject(), game)) {
|
||||||
|| filter.match(mana.getSourceObject(), game)) {
|
|
||||||
return new ConditionalManaInfo(manaTypeToUse, mana.getSourceObject());
|
return new ConditionalManaInfo(manaTypeToUse, mana.getSourceObject());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -239,18 +238,10 @@ public class ManaPool implements Serializable {
|
||||||
this.manaBecomesBlack = manaBecomesBlack;
|
this.manaBecomesBlack = manaBecomesBlack;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isManaBecomesBlack() {
|
|
||||||
return manaBecomesBlack;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setManaBecomesColorless(boolean manaBecomesColorless) {
|
public void setManaBecomesColorless(boolean manaBecomesColorless) {
|
||||||
this.manaBecomesColorless = manaBecomesColorless;
|
this.manaBecomesColorless = manaBecomesColorless;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isManaBecomesColorless() {
|
|
||||||
return manaBecomesColorless;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void init() {
|
public void init() {
|
||||||
manaItems.clear();
|
manaItems.clear();
|
||||||
}
|
}
|
||||||
|
|
@ -393,7 +384,7 @@ public class ManaPool implements Serializable {
|
||||||
return conditionalMana;
|
return conditionalMana;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean ConditionalManaHasManaType(ManaType manaType) {
|
public boolean conditionalManaHasManaType(ManaType manaType) {
|
||||||
for (ManaPoolItem item : manaItems) {
|
for (ManaPoolItem item : manaItems) {
|
||||||
if (item.isConditional()) {
|
if (item.isConditional()) {
|
||||||
if (item.getConditionalMana().get(manaType) > 0) {
|
if (item.getConditionalMana().get(manaType) > 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue