compare with zero in a more delicate way

This commit is contained in:
Maxmtg
2013-03-02 12:17:12 +00:00
parent ff079efed5
commit 613dd2bac1
2 changed files with 5 additions and 1 deletions

View File

@@ -78,7 +78,7 @@ public class Cost {
* @return a boolean.
*/
public final boolean hasNoManaCost() {
return this.getTotalMana().toString().equals(ManaCost.ZERO.toString());
return this.getTotalMana().isZero();
}
/**

View File

@@ -183,6 +183,10 @@ public final class ManaCost implements Comparable<ManaCost> {
return this.shards.isEmpty() && !this.isNoCost();
}
public boolean isZero() {
return genericCost == 0 && isPureGeneric();
}
/*
* (non-Javadoc)
*