forked from External/mage
Fixes to Mana.enough: mana of any color (ManaType.Any) was being used to pay for colourless mana. Fixes for Mana.needed: mana of any color (ManaType.Any) was being used to pay for colourless mana. calculation for generic mana remaining was using min(0, available) instead of max(0, available) meaning that leftover mana of other types was never used to pay for any leftover generic costs. Other: Added tests for both .needed and .enough. Moved tests some tests from ManaUtilTest to ManaTest Simplified Mana.subtractCosts by calling Mana.substract first to make use of common functionality. Added more documentation Added tests for both .needed Added more tests for .enough to cover the changes with colourless mana.
This commit is contained in:
parent
16914632c4
commit
e679574a15
4 changed files with 293 additions and 196 deletions
|
|
@ -449,9 +449,14 @@ public final class ManaUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Converts a collection of mana symbols into a single condensed string e.g.
|
||||
* {1}{1}{1}{1}{1}{W} = {5}{W} {2}{B}{2}{B}{2}{B} = {6}{B}{B}{B}
|
||||
* {1}{2}{R}{U}{1}{1} = {5}{R}{U} {B}{G}{R} = {B}{G}{R}
|
||||
* Converts a collection of mana symbols into a single condensed string e.g:
|
||||
* {1}{1}{1}{1}{1}{W} = {5}{W}
|
||||
* {2}{B}{2}{B}{2}{B} = {6}{B}{B}{B}
|
||||
* {1}{2}{R}{U}{1}{1} = {5}{R}{U}
|
||||
* {B}{G}{R} = {B}{G}{R}
|
||||
*
|
||||
* @param rawCost the uncondensed version of the mana String.
|
||||
* @return the condensed version of the mana String.
|
||||
*/
|
||||
public static String condenseManaCostString(String rawCost) {
|
||||
int total = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue