mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Add colorless shards to Statistics view
This commit is contained in:
@@ -55,4 +55,13 @@ public abstract class ManaAtom {
|
||||
}
|
||||
return 0; // generic
|
||||
}
|
||||
|
||||
public static int getIndexOfFirstManaType(final byte color){
|
||||
for (int i = 0; i < MANATYPES.length; i++) {
|
||||
if ((color & MANATYPES[i]) != 0) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1; // colorless
|
||||
}
|
||||
}
|
||||
@@ -167,7 +167,7 @@ public final class ManaCost implements Comparable<ManaCost>, Iterable<ManaCostSh
|
||||
* @return an array of five integers containing the amount of color shards in the card's mana cost in WUBRG order
|
||||
*/
|
||||
public int[] getColorShardCounts() {
|
||||
int[] counts = new int[5]; // in WUBRG order
|
||||
int[] counts = new int[6]; // in WUBRGC order
|
||||
|
||||
for (int i = 0; i < stringValue.length(); i++) {
|
||||
char symbol = stringValue.charAt(i);
|
||||
@@ -177,7 +177,8 @@ public final class ManaCost implements Comparable<ManaCost>, Iterable<ManaCostSh
|
||||
case 'B':
|
||||
case 'R':
|
||||
case 'G':
|
||||
counts[MagicColor.getIndexOfFirstColor(MagicColor.fromName(symbol))]++;
|
||||
case 'C':
|
||||
counts[ManaAtom.getIndexOfFirstManaType(ManaAtom.fromName(symbol))]++;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -313,8 +314,8 @@ public final class ManaCost implements Comparable<ManaCost>, Iterable<ManaCostSh
|
||||
|
||||
/**
|
||||
* TODO: Write javadoc for this method.
|
||||
* @param manaCost
|
||||
* @param manaCost2
|
||||
* @param a
|
||||
* @param b
|
||||
* @return
|
||||
*/
|
||||
public static ManaCost combine(ManaCost a, ManaCost b) {
|
||||
|
||||
Reference in New Issue
Block a user