shifted MagicColors 1 bit to the right

This commit is contained in:
Maxmtg
2014-02-02 01:08:53 +00:00
parent 2fcc5943fa
commit 1f66ec432d
2 changed files with 6 additions and 6 deletions

View File

@@ -62,7 +62,7 @@ public final class ColorSet implements Comparable<ColorSet>, Iterable<Byte> {
}
public static ColorSet fromMask(final int mask) {
int mask32 = (mask & MagicColor.ALL_COLORS) >> 1;
int mask32 = mask & MagicColor.ALL_COLORS;
if (allColors[mask32] == null) {
allColors[mask32] = new ColorSet((byte) mask);
}

View File

@@ -11,11 +11,11 @@ import com.google.common.collect.ImmutableList;
public class MagicColor {
public static final byte COLORLESS = 0;
public static final byte WHITE = 1 << 1;
public static final byte BLUE = 1 << 2;
public static final byte BLACK = 1 << 3;
public static final byte RED = 1 << 4;
public static final byte GREEN = 1 << 5;
public static final byte WHITE = 1 << 0;
public static final byte BLUE = 1 << 1;
public static final byte BLACK = 1 << 2;
public static final byte RED = 1 << 3;
public static final byte GREEN = 1 << 4;
public static final byte ALL_COLORS = BLACK | BLUE | WHITE | RED | GREEN;
public static final int NUMBER_OR_COLORS = 5;