mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
fixed Mana Web not taking colorless mana into account
This commit is contained in:
parent
dbb185c47a
commit
9797f4d23b
2 changed files with 10 additions and 3 deletions
|
|
@ -846,15 +846,20 @@ public class Mana implements Comparable<Mana>, Serializable, Copyable<Mana> {
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean containsAny(final Mana mana) {
|
||||
return containsAny(mana, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if this objects mana contains any coloured mana the same as the
|
||||
* passed in {@link Mana}'s mana.
|
||||
*
|
||||
* @param mana the mana to check for
|
||||
* @param includeColorless also check for colorless
|
||||
* @return true if this contains any of the same type of coloured mana that
|
||||
* this has
|
||||
*/
|
||||
public boolean containsAny(final Mana mana) {
|
||||
public boolean containsAny(final Mana mana, boolean includeColorless) {
|
||||
if (mana.black > 0 && this.black > 0) {
|
||||
return true;
|
||||
} else if (mana.blue > 0 && this.blue > 0) {
|
||||
|
|
@ -865,6 +870,8 @@ public class Mana implements Comparable<Mana>, Serializable, Copyable<Mana> {
|
|||
return true;
|
||||
} else if (mana.green > 0 && this.green > 0) {
|
||||
return true;
|
||||
} else if (mana.colorless > 0 && this.colorless > 0 && includeColorless) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue